Compare commits

..

90 Commits

Author SHA1 Message Date
Robert Osfield
b02a5b85a6 Release OpenSceneGraph-3.0.1 2011-07-31 08:23:17 +00:00
Robert Osfield
45d5cc4745 Updated ChangeLog and READEME.txt for 3.0.1 release 2011-07-31 08:21:58 +00:00
Robert Osfield
54bafb9cc6 Changed release candidate numbe for 3.0.1 release. 2011-07-31 07:50:34 +00:00
Robert Osfield
97b6099fa5 Changed the handling of the ambient contribution of light to avoid lighting errors in the shadowed region outside a spointlight. 2011-07-31 07:48:22 +00:00
Robert Osfield
03b59e970b Merged from svn/trunk revision 12735, fixed console output of end of frame barrier position. 2011-07-29 07:44:01 +00:00
Robert Osfield
60746206f1 Updated ChangeLog and release candidate number for 3.0.1-rc3 2011-07-28 16:59:15 +00:00
Robert Osfield
84f4ff1d96 Improved the handling of scaling of dicom imagery. 2011-07-28 16:41:09 +00:00
Robert Osfield
c68440f3cb Merged from svn/trunk revision 12722. Refectored the EGL setup so that it's honours the Traits values. 2011-07-28 12:08:40 +00:00
Robert Osfield
42d6b86530 Merged from svn/trunk, revision 12727, Reverted the change to the default setting of _resizeNonPowerOfTwoHint back to true for all platforms to ensure the
same behaivour across platforms, something that can be achieved now thanks to the integrated GLU library.

Corrected the default of the ResizeNonPowerOfTwoHint to true to reflect the actual default setting set by the
Texture default constructor.
2011-07-28 11:05:35 +00:00
Robert Osfield
866da7bdd5 From Johannes Baeuerle, merged from svn/trunk revision 12725, "in the file src/osgDB/ObjectWrapper.cpp, where the GlobalLookupTable for gl enums for serialization purposes is defined, some of the compressed texture formats are missing. I added enums for the pvr and etc formats." 2011-07-28 08:19:42 +00:00
Robert Osfield
14b8c242cf From Jason Beverage, merged from svn/trunk revision 12723, "Here is a small fix for getCameraContainingPosition. getXMin was
being used in a case where getYMin should be used instead."
2011-07-28 07:47:06 +00:00
Robert Osfield
ad817735cf Updated ChangeLog and AUTHORS file for 3.0.1-rc2 2011-07-25 19:28:54 +00:00
Robert Osfield
ede2f9d58a Updated release candidate number 2011-07-25 18:39:23 +00:00
Robert Osfield
9a44ab4440 Merged from svn/trunk revision 12818, "Fixed stats bug where not all stats fields were being collected by the cull_draw() method used in the SingleThreaded and CullDrawThreadPerContext threading models." 2011-07-25 17:08:57 +00:00
Robert Osfield
be9bd9cd08 From Alexander Irion, merged from svn/trunk revision 12716, "Texture borders are not supported in ES.
_isTextureBorderClampSupported is set to "TRUE" in Texture.cpp, because of the version number check (GL VERSION >= 1.3).

This leads to an invalid enum error, when GL_TEXTURE_BORDER_COLOR is tried to set."
2011-07-22 09:28:48 +00:00
Robert Osfield
4d19d54de5 Merged from svn/trunk revision 12714, "In the RecordCameraPathhandler fixed the handling of pressing 'Z' before 'z' which was causing the view
to be reset to 0,0,0 by AnimationPathManipualtor with an empty AnimationPath."
2011-07-22 08:26:36 +00:00
Robert Osfield
83887b61d7 Updated ChangeLog, Version and AUTHORS file for 3.0.1-rc1 2011-07-21 09:54:48 +00:00
Robert Osfield
90afef26bb Merged from svn/trunk, workaround to culling issues assocaited with text that is set to scale relative to screen coords or is rotated to the screen. 2011-07-21 09:19:45 +00:00
Robert Osfield
1753cad35f From Mathias Froehlich, merged from svn/trunk revision 12708, "I have attached an updated version of the VRML2 loader.
That change is the result of the '[osgPlugins] VRML plugin - "file" url'
discussion on osg-users.

The attached change avoids rewriting file names into some kind of file urls
and then use the url for opening an fstream. Instead just use the given file
name to open the stream.
Also this change adds some Notify output for the error paths."
2011-07-21 09:10:31 +00:00
Robert Osfield
df098a3a8d From Wang Rui, merged from svn/trunk revision 12706, "This fixes a small problem in the FindFBX file. In CMake scripts,
VS2010 is not marked as MSVC100 but MSVC10. And CMake defines
MSVC_VERSION instead of MSVC_VER to indicate the version number. The
modification can find fbx sdk for VS2010 automatically now.
"
2011-07-21 08:53:08 +00:00
Robert Osfield
87bf7980e2 From Claus Scheiblauer, merged from svn/trunk revision 12704, fixed handling of horizontal mouse wheel event 2011-07-20 10:18:31 +00:00
Robert Osfield
5b4051d9e8 Merged from svn/trunk revision 12701. Added doxygen comments explain read file callback functionality. 2011-07-18 12:44:43 +00:00
Robert Osfield
75bce7da0b Merged from svn/trunk revision, 12699, build fix for Cygwin/Mingw builds of DCMTK. 2011-07-18 09:42:29 +00:00
Robert Osfield
b1045223f1 From Alberto Luaces, merged from svn/trunk revision 12697, typo fixes 2011-07-17 16:26:38 +00:00
Robert Osfield
68a97a6424 From Wang Rui, merged from svn/trunk revision 12695. "improved the handling of the _preReadString within the readWrappedString method by factoring the
reading of the next character into a dedicated getCharacter(..) method."
2011-07-17 10:33:46 +00:00
Robert Osfield
419a228fe9 From Wang Rui, merged from svn/trunk revision 12693, "I've found that the latest ffmpeg made some functions and macros
deprecated, which led to compilation errors in the OSG plugin. I tried
fixing them and tested with the version ffmpeg-git-5d4fd1d (ffmpeg
version > 0.8, libavcodec = 53.7.0) under Windows."
2011-07-15 10:25:12 +00:00
Robert Osfield
b970343c47 From Sukender, merged from svn/trunk revision 12690. Fixed compiler error "public: static char const * const osg::ValueObjectClassNameTrait< xxx >::s_className" already defined in xxx.obj" 2011-07-15 09:48:12 +00:00
Robert Osfield
9529b14f3c From Wang Rui, merged from svn/trunk revision 12688. "The files attached should be separately put into the directories
src/osgPlugins/osg and src/osgWrappers/serializers/osgSim. They fix a
serious infinite loop problem that may be caused by the stream buffer
mechanism under Windows and some osgSim wrapper bugs pointed by
Andreas. I've asked the community to help test them and hope now we
can solve these recent .osgt file reading issues."
2011-07-15 09:16:33 +00:00
Robert Osfield
902c4aa1e9 From Ryan Pavlik, Merged from svn/trunk revision 12686. "Fix inventor state copy constructor.
Clang warning:
    In file included from src/osgPlugins/Inventor/ConvertToInventor.cpp:80:
    src/osgPlugins/Inventor/ConvertToInventor.h:117:71: warning: field is uninitialized when used here [-Wuninitialized]
            osgTexGenS(s.osgTexGenS), osgTexGenT(s.osgTexGenT), osgTexGen(osgTexGen),
                                                                          ^"
2011-07-15 08:45:54 +00:00
Robert Osfield
c0d2ccc017 From Philip Lamp, Merged from svn/trunk revision 12683. "Modify the ReaderWriteImageIO_IOS to correctly handle relative paths
when reading from a file. This means that no longer do all image files
have to live at the root of the Resources folder inside the app bundle,
but can now be organized inside folders. Also improved error handling
and fixed a potential leak of a CGColorSpaceRef each once per image load."
2011-07-15 08:37:15 +00:00
Robert Osfield
0ce917d3bb Removed redudent lines and changes tabs to four spaces 2011-07-15 08:35:44 +00:00
Robert Osfield
806993f3e0 Updated ChangeLog and add fix for typo of name 2011-06-28 07:52:55 +00:00
Robert Osfield
8f4c026a85 Fixed typo and added entry about osgParticle. 2011-06-28 07:37:19 +00:00
Robert Osfield
373687b72f From Wang Rui, merged from changeset 12674. "I've found a small problem which causes crashes in the 3ds plugin
while trying to load a model. The fix here will ensure that the
texture map is valid and everything could work well then."
2011-06-28 07:28:10 +00:00
Robert Osfield
73026ea973 Merged from svn/trunk changeset 12675, "Added #if lib curl version check around #include <curl/types.h> as this header was deprecated and now
removed entirely from libcurl-7.21.7."
2011-06-28 07:25:43 +00:00
Robert Osfield
55ff7019a1 Updated dates in prep for release. 2011-06-27 22:04:22 +00:00
Robert Osfield
efa37bd4c4 From Jean-Sebestien Guay, merged from svn/trunk changeset 12669/12670 - fix for windows bug when reading ascii files with unix file endings. 2011-06-27 21:36:21 +00:00
Robert Osfield
b4a32f6cab Updated NEWS 2011-06-27 13:42:56 +00:00
Robert Osfield
9ffd6d1dc0 Updated NEWS for 3.0.0 2011-06-27 13:16:22 +00:00
Robert Osfield
701c976495 Update AUTHORS file for 3.0.0. 2011-06-27 12:59:45 +00:00
Robert Osfield
3f7406e903 Updated ChangeLOG, NEWS and READE for 3.0.0 release 2011-06-27 12:08:05 +00:00
Robert Osfield
0079c132a7 Updated Version number to final 3.0.0 configuration. 2011-06-27 10:45:36 +00:00
Robert Osfield
3254630625 Merged doxygen comment improvement from svn/trunk. 2011-06-27 10:22:03 +00:00
Robert Osfield
125fa6d05d Merged from svn/trunk changeset 12656. From Andreas Eskland, "I found that a binary PNM file couldn't be read by the PNM plugin in the 3.0 branch. Attached is a small fix in ReaderWriterPNM.cpp, simply opening the file in binary mode." 2011-06-25 20:55:01 +00:00
Robert Osfield
a92241d40d Merged from svn/trunk changset 12654. Fixed memory growth issue when using Texture2D::SubloadCallbacks that don't set the TextureObjects sizes. 2011-06-25 11:02:09 +00:00
Robert Osfield
8ea9d68c9c Merged from svn/trunk changeset 12652, Tighten up float usage 2011-06-25 07:07:58 +00:00
Robert Osfield
1e94ed9fa8 Updated ChangeLog and AUTHORS file for 3.0.0-rc5 2011-06-24 19:45:21 +00:00
Robert Osfield
cd7dc0f161 Merged from svn/trunk changeset 12648, tightened up float/double usage 2011-06-24 19:18:53 +00:00
Robert Osfield
6779944c0e Updated ChangeLog, NEWS and READE for 3.0.0-rc5 2011-06-24 16:27:42 +00:00
Robert Osfield
d5f476a822 Merged from svn/trunk changeset 12645. Removed redundent assert and associated variables to fix warnings. 2011-06-24 16:16:04 +00:00
Robert Osfield
b361047aa0 Updated release candidate number to 5 for 3.0.0-rc5 2011-06-24 16:05:23 +00:00
Robert Osfield
bd2ad48c00 Merged from svn/trunk changeset 12642, "Implemented missing writeShader" 2011-06-24 15:05:28 +00:00
Robert Osfield
e306f27e23 Merged from svn/trunk changeset 12640, From Martin Innus, fixed erroneous change of INTEGER to UNKNOWN, reverting back to INTEGER. 2011-06-24 13:36:45 +00:00
Robert Osfield
26ee7e07d3 Merged from svn/trunk changeset 12638:
Implemented missing Archive::readShader/writeShader, and added searching of the archive list in Registr::read() so that files
that are stored in the archives can be found.
2011-06-24 12:52:11 +00:00
Robert Osfield
3660e3a3c3 Merged from svn/trunk changeset 12636, "While we're on osgSim/ShapeAttribute, here's a fix that fixes the 'UNKNOW' typo and some
doxygen"
2011-06-24 08:33:58 +00:00
Robert Osfield
cb627520a7 From Wang Rui, Merged from svn/trunk changeset 12633.
"I've modified the code to handle -1.#IND and other kinds of infinite
values. Please see the attachments for details"
2011-06-24 08:16:59 +00:00
Robert Osfield
c5867e4957 Merged from svn/trunk changeset 12632. Added operator ==, != and < to fix VS build 2011-06-24 08:15:51 +00:00
Robert Osfield
8f20178748 Merged from svn/trunk changeset r12628.
Fixed warnings generated by clang,

src/osgAnimation/Skeleton.cpp:25:87: warning: addition of default argument on redeclaration makes this constructor a copy constructor [-Wdefault-arg-special-member]
Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop= osg::CopyOp::SHALLOW_COPY) : osg::Object(us, copyop), osg::NodeCallback(us, copyop)

/src/OpenThreads/pthreads/PThread.cpp:1024:15: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
    if (cpunum<0) return -1;

src/osgDB/ExternalFileWriter.cpp:221:122: warning: expression result unused [-Wunused-value]
    _objects.insert(ObjectsSet::value_type(&obj, ObjectData(absoluteDestinationPath, relativeDestinationPath, written))).first;

src/osgManipulator/Dragger.cpp:175:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (*itr = constraint) return;

src/osgManipulator/Dragger.cpp:187:18: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (*itr = constraint)
2011-06-23 20:09:26 +00:00
Robert Osfield
c93ef23d2f Updated release candidate number to 4. 2011-06-23 20:03:16 +00:00
Robert Osfield
69659ade08 Merged from svn/trunk changeset r12573, Added catch for window manager doesn't set the window size to full screen. 2011-06-23 18:29:35 +00:00
Robert Osfield
d4e68e5d73 Merged from svn/trunk changeset 12625. Warning fixes for:
OpenSceneGraph/src/osgPlugins/Inventor/ConvertFromInventor.cpp: In member function ?virtual SbBool SoVRMLImageTextureOsg::readInstance(SoInput*, short unsigned int)?:
OpenSceneGraph/src/osgPlugins/Inventor/ConvertFromInventor.cpp:1264:16: warning: variable ?retval? set but not used [-Wunused-but-set-variable]
OpenSceneGraph/src/osgPlugins/ac/Geode.cpp: In member function ?void ac3d::Geode::ProcessGeometry(std::ostream&, unsigned int)?:
OpenSceneGraph/src/osgPlugins/ac/Geode.cpp:806:35: warning: variable ?fRep_s? set but not used [-Wunused-but-set-variable]
OpenSceneGraph/src/osgPlugins/ac/Geode.cpp:806:43: warning: variable ?fRep_t? set but not used [-Wunused-but-set-variable]
OpenSceneGraph/src/osgPlugins/ac/Geode.cpp:807:35: warning: variable ?fOffset_s? set but not used [-Wunused-but-set-variable]
OpenSceneGraph/src/osgPlugins/ac/Geode.cpp:807:46: warning: variable ?fOffset_t? set but not used [-Wunused-but-set-variable]
OpenSceneGraph/src/osgViewer/GraphicsWindowX11.cpp: In member function ?virtual void osgViewer::GraphicsWindowX11::checkEvents()?:
OpenSceneGraph/src/osgViewer/GraphicsWindowX11.cpp:1181:10: warning: variable ?destroyWindowRequested? set but not used [-Wunused-but-set-variable]
2011-06-23 18:26:11 +00:00
Robert Osfield
b29bf3fe06 Merged from svn/trunk changeset 12623.Fixed virtual method mismtaches between subclasses and parent classes. 2011-06-23 16:39:25 +00:00
Robert Osfield
8f23b42ed2 From Ulrich Hertlein, build fix for OSX. 2011-06-23 15:42:44 +00:00
Robert Osfield
17d876f787 Merged from svn/trunk, changeset 12619, "Added better handling of archives in ReaderWriterZip::readNode() so that if there is no master file definition it
loads all the available nodes in the zip archive and returns an osg::Group containing all the nodes if there is more
than one, or just returns the node if there is just one.  Also implemented this functionality for ReaderWriterZip::readImage()."
2011-06-23 15:39:11 +00:00
Robert Osfield
5cb72e06c2 Fixed typo in name 2011-06-23 12:25:52 +00:00
Robert Osfield
68ac058045 Updated ChangeLog and AUTHORS files 2011-06-23 11:32:24 +00:00
Robert Osfield
75fa5c0555 Fixed name typos 2011-06-23 11:32:09 +00:00
Robert Osfield
3159b36acd Merged from svn/trunk changeset r12611.
Fixed warnings.

OpenSceneGraph/src/osgGA/NodeTrackerManipulator.cpp:32:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgGA/TerrainManipulator.cpp:31:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/include/osgSim/ShapeAttribute:99:9: warning: base class ?class std::vector<osgSim::ShapeAttribute>? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::gi?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::byte_before_the_zipfile?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::num_file?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::pos_in_central_dir?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::current_file_ok?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::central_pos?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::size_central_dir?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::offset_central_dir?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::cur_file_info?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::cur_file_info_internal?
OpenSceneGraph/src/osgPlugins/zip/unzip.cpp:3102:14: warning: missing initializer for member ?unz_s::pfile_in_zip_read?
OpenSceneGraph/src/osgViewer/CompositeViewer.cpp:30:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgViewer/View.cpp:159:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgViewer/Viewer.cpp:196:1: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
OpenSceneGraph/src/osgViewer/Viewer.cpp:196:1: warning: base class ?class osgViewer::ViewerBase? should be explicitly initialized in the copy constructor
OpenSceneGraph/include/osgManipulator/Dragger:47:9: warning: base class ?class osg::Object? should be explicitly initialized in the copy constructor
2011-06-23 11:10:54 +00:00
Robert Osfield
893a6365a4 From Ryan Pavlik, merge from svn/trunk changeset 12608, "I have successfully compiled OpenSceneGraph trunk using the Clang compiler (using a recent trunk build of llvm and clang, haven't tested an older release). The attached files contain the change shown in the diff below, which was required to finish the build with Clang. It fixes an issue with two-phase name lookup - there's more information here http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html" 2011-06-23 09:39:45 +00:00
Robert Osfield
e330051cf3 Converted tabs to four spaces 2011-06-23 09:27:25 +00:00
Robert Osfield
672777189a From Dimi Christopoulos, merged from svn/trunk changeset 12606."I attach a fixed version of mipmap.cpp which produced a lot of warning on my gcc
compiler."
2011-06-23 09:24:38 +00:00
Robert Osfield
1ef313787d Update ChangeLog and AUTHORs file for 3.0.0-rc3 2011-06-22 16:34:46 +00:00
Robert Osfield
35c26bb5aa From Magnus Kessler, "I have recently installed the latest version of collada-dom on Linux, and
found that the include path has changed. By default, collada-dom now installs
its header files under /usr/local/include/collada-dom or/usr/include/collada-
dom. The attached FindCollada.cmake has been updated to look for these
locations in addition to the previous candidate locations."
2011-06-22 16:18:52 +00:00
Robert Osfield
8aee244e64 Updated ChangeLog and AUTHORS file for release 2011-06-22 15:41:57 +00:00
Robert Osfield
12ca59d3e5 Updated RC number for the 3.0.0-rc3 2011-06-22 12:45:35 +00:00
Robert Osfield
93156fd2ce Merged from svn/trunk changeset 12597:
Resolved warnings reported by g++ 4.6's -Wunused-but-set-variable.

Warnings were:

src/osg/ShapeDrawable.cpp: In member function ?void PrimitiveShapeVisitor::createHalfSphere(unsigned int, unsigned int, float, int, float, const Matrix&)?:
src/osg/ShapeDrawable.cpp:1409:11: warning: variable ?nzBase? set but not used [-Wunused-but-set-variable]
src/osg/ShapeDrawable.cpp:1410:11: warning: variable ?nRatioBase? set but not used [-Wunused-but-set-variable]
src/osgUtil/DelaunayTriangulator.cpp: In function ?osgUtil::Triangle_list osgUtil::fillHole(osg::Vec3Array*, std::vector<unsigned int, std::allocator<unsigned int> >)?:
src/osgUtil/DelaunayTriangulator.cpp:569:27: warning: variable ?ptest? set but not used [-Wunused-but-set-variable]
src/osgUtil/DelaunayTriangulator.cpp: In member function ?bool osgUtil::DelaunayTriangulator::triangulate()?:
src/osgUtil/DelaunayTriangulator.cpp:979:45: warning: variable ?curp? set but not used [-Wunused-but-set-variable]
src/osgUtil/RenderStage.cpp: In member function ?void osgUtil::RenderStage::runCameraSetUp(osg::RenderInfo&)?:
src/osgUtil/RenderStage.cpp:631:18: warning: variable ?stencilAttached? set but not used [-Wunused-but-set-variable]
src/osgText/FadeText.cpp: In member function ?void FadeTextPolytopeData::buildPolytope()?:
src/osgText/FadeText.cpp:74:20: warning: variable ?edge23? set but not used [-Wunused-but-set-variable]
src/osgText/FadeText.cpp:75:20: warning: variable ?edge30? set but not used [-Wunused-but-set-variable]
src/osgText/Text.cpp: In member function ?void osgText::Text::computeBackdropPositions(unsigned int) const?:
src/osgText/Text.cpp:747:10: warning: variable ?is_valid_size? set but not used [-Wunused-but-set-variable]
src/osgGA/NodeTrackerManipulator.cpp: In member function ?virtual bool osgGA::NodeTrackerManipulator::performMovementLeftMouseButton(double, double, double)?:
src/osgGA/NodeTrackerManipulator.cpp:257:21: warning: variable ?lookVector? set but not used [-Wunused-but-set-variable]
src/osgGA/NodeTrackerManipulator.cpp:259:21: warning: variable ?upVector? set but not used [-Wunused-but-set-variable]
src/osgGA/TerrainManipulator.cpp: In member function ?virtual bool osgGA::TerrainManipulator::performMovementMiddleMouseButton(double, double, double)?:
src/osgGA/TerrainManipulator.cpp:217:11: warning: variable ?lookVector? set but not used [-Wunused-but-set-variable]
src/osgGA/TerrainManipulator.cpp:219:11: warning: variable ?upVector? set but not used [-Wunused-but-set-variable]
src/osgVolume/FixedFunctionTechnique.cpp: In member function ?virtual void osgVolume::FixedFunctionTechnique::init()?:
src/osgVolume/FixedFunctionTechnique.cpp:124:30: warning: variable ?tf? set but not used [-Wunused-but-set-variable]
src/osgParticle/FluidProgram.cpp: In member function ?virtual void osgParticle::FluidProgram::execute(double)?:
src/osgParticle/FluidProgram.cpp:38:23: warning: variable ?velBefore? set but not used [-Wunused-but-set-variable]
src/osgShadow/ParallelSplitShadowMap.cpp: In member function ?virtual void osgShadow::ParallelSplitShadowMap::cull(osgUtil::CullVisitor&)?:
src/osgShadow/ParallelSplitShadowMap.cpp:593:22: warning: variable ?bb? set but not used [-Wunused-but-set-variable]
src/osgTerrain/GeometryTechnique.cpp: In member function ?virtual void osgTerrain::GeometryTechnique::generateGeometry(osgTerrain::GeometryTechnique::BufferData&, osgTerrain::Locator*, const osg::Vec3d&)?:
src/osgTerrain/GeometryTechnique.cpp:777:12: warning: variable ?i_sampleFactor? set but not used [-Wunused-but-set-variable]
src/osgTerrain/GeometryTechnique.cpp:778:12: warning: variable ?j_sampleFactor? set but not used [-Wunused-but-set-variable]
src/osgPlugins/dds/ReaderWriterDDS.cpp: In function ?osg::Image* ReadDDSFile(std::istream&)?:
src/osgPlugins/dds/ReaderWriterDDS.cpp:314:10: warning: variable ?is3dImage? set but not used [-Wunused-but-set-variable]
src/osgPlugins/dds/ReaderWriterDDS.cpp: In function ?bool WriteDDSFile(const osg::Image*, std::ostream&)?:
src/osgPlugins/dds/ReaderWriterDDS.cpp:721:10: warning: variable ?is3dImage? set but not used [-Wunused-but-set-variable]
src/osgPlugins/hdr/hdrloader.cpp: In static member function ?static bool HDRLoader::load(const char*, bool, HDRLoaderResult&)?:
src/osgPlugins/hdr/hdrloader.cpp:101:10: warning: variable ?cmd? set but not used [-Wunused-but-set-variable]
src/osgPlugins/vtf/ReaderWriterVTF.cpp: In function ?osg::Image* ReadVTFFile(std::istream&)?:
src/osgPlugins/vtf/ReaderWriterVTF.cpp:360:23: warning: variable ?base? set but not used [-Wunused-but-set-variable]
src/osgPlugins/jp2/ReaderWriterJP2.cpp: In function ?int putdata(jas_stream_t*, jas_image_t*, int)?:
src/osgPlugins/jp2/ReaderWriterJP2.cpp:41:13: warning: variable ?linelen? set but not used [-Wunused-but-set-variable]
src/osgPlugins/Inventor/ConvertToInventor.cpp: In member function ?void ConvertToInventor::processGeometry(const osg::Geometry*, ConvertToInventor::InventorState*)?:
src/osgPlugins/Inventor/ConvertToInventor.cpp:1639:10: warning: variable ?ok? set but not used [-Wunused-but-set-variable]
src/osgPlugins/Inventor/ConvertFromInventor.cpp: In member function ?virtual SbBool SoVRMLImageTextureOsg::readInstance(SoInput*, short unsigned int)?:
src/osgPlugins/Inventor/ConvertFromInventor.cpp:1264:16: warning: variable ?retval? set but not used [-Wunused-but-set-variable]
src/osgPlugins/OpenFlight/GeometryRecords.cpp: In member function ?virtual void flt::Face::readRecord(flt::RecordInputStream&, flt::Document&)?:
src/osgPlugins/OpenFlight/GeometryRecords.cpp:369:19: warning: variable ?secondaryPackedColor? set but not used [-Wunused-but-set-variable]
src/osgPlugins/OpenFlight/GeometryRecords.cpp: In member function ?virtual void flt::Mesh::readRecord(flt::RecordInputStream&, flt::Document&)?:
src/osgPlugins/OpenFlight/GeometryRecords.cpp:942:19: warning: variable ?secondaryPackedColor? set but not used [-Wunused-but-set-variable]
src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp: In member function ?virtual osgDB::ReaderWriter::ReadResult FLTReaderWriter::readNode(std::istream&, const Options*) const?:
src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp:427:40: warning: variable ?pos? set but not used [-Wunused-but-set-variable]
src/osgPlugins/ive/ShapeAttributeList.cpp: In member function ?void ive::ShapeAttributeList::write(ive::DataOutputStream*)?:
src/osgPlugins/ive/ShapeAttributeList.cpp:31:48: warning: variable ?it? set but not used [-Wunused-but-set-variable]
src/osgPlugins/ac/Geode.cpp: In member function ?void ac3d::Geode::ProcessGeometry(std::ostream&, unsigned int)?:
src/osgPlugins/ac/Geode.cpp:806:35: warning: variable ?fRep_s? set but not used [-Wunused-but-set-variable]
src/osgPlugins/ac/Geode.cpp:806:43: warning: variable ?fRep_t? set but not used [-Wunused-but-set-variable]
src/osgPlugins/ac/Geode.cpp:807:35: warning: variable ?fOffset_s? set but not used [-Wunused-but-set-variable]
src/osgPlugins/ac/Geode.cpp:807:46: warning: variable ?fOffset_t? set but not used [-Wunused-but-set-variable]
src/osgPlugins/ac/Geode.cpp:932:38: warning: variable ?primLength? set but not used [-Wunused-but-set-variable]
src/osgPlugins/txp/trpage_geom.cpp: In member function ?virtual bool trpgGeometry::Write(trpgWriteBuffer&)?:
src/osgPlugins/txp/trpage_geom.cpp:615:19: warning: variable ?u? set but not used [-Wunused-but-set-variable]
src/osgPlugins/txp/trpage_material.cpp: In member function ?int trpgMatTable::AddMaterial(const trpgMaterial&, bool)?:
src/osgPlugins/txp/trpage_material.cpp:103:10: warning: variable ?spaceInTable? set but not used [-Wunused-but-set-variable]
src/osgPlugins/txp/trpage_rarchive.cpp: In member function ?virtual bool trpgr_Archive::ReadHeader(bool)?:
src/osgPlugins/txp/trpage_rarchive.cpp:261:14: warning: variable ?headerHasTexTable? set but not used [-Wunused-but-set-variable]
src/osgPlugins/zip/unzip.cpp: In member function ?ZRESULT TUnzip::Get(int, ZIPENTRY*)?:
src/osgPlugins/zip/unzip.cpp:4055:8: warning: variable ?hidden? set but not used [-Wunused-but-set-variable]
src/osgPlugins/zip/unzip.cpp:4055:22: warning: variable ?system? set but not used [-Wunused-but-set-variable]
src/osgPlugins/zip/unzip.cpp:4055:36: warning: variable ?archive? set but not used [-Wunused-but-set-variable]
src/osgPlugins/zip/ZipArchive.cpp: In member function ?virtual bool ZipArchive::getFileNames(osgDB::Archive::FileNameList&) const?:
src/osgPlugins/zip/ZipArchive.cpp:91:37: warning: variable ?iterEnd? set but not used [-Wunused-but-set-variable]
src/osgPlugins/pvr/ReaderWriterPVR.cpp: In member function ?osgDB::ReaderWriter::ReadResult ReaderWriterPVR::readPVRStream(std::istream&) const?:
src/osgPlugins/pvr/ReaderWriterPVR.cpp:155:14: warning: variable ?hasAlpha? set but not used [-Wunused-but-set-variable]
src/osgViewer/View.cpp: In function ?osg::Geometry* create3DSphericalDisplayDistortionMesh(const Vec3&, const Vec3&, const Vec3&, double, double, osg::Image*, const Matrix&)?:
src/osgViewer/View.cpp:737:15: warning: variable ?cursor? set but not used [-Wunused-but-set-variable]
src/osgViewer/View.cpp: In function ?osg::Geometry* createParoramicSphericalDisplayDistortionMesh(const Vec3&, const Vec3&, const Vec3&, double, double, osg::Image*, const Matrix&)?:
src/osgViewer/View.cpp:1130:19: warning: variable ?cursor? set but not used [-Wunused-but-set-variable]
src/osgViewer/View.cpp:1118:15: warning: variable ?dx? set but not used [-Wunused-but-set-variable]
src/osgViewer/GraphicsWindowX11.cpp: In member function ?virtual void osgViewer::GraphicsWindowX11::checkEvents()?:
src/osgViewer/GraphicsWindowX11.cpp:1181:10: warning: variable ?destroyWindowRequested? set but not used [-Wunused-but-set-variable]
src/osgPlugins/cfg/ConfigParser.cpp: In member function ?bool osgProducer::CameraConfig::parseFile(const string&)?:
src/osgPlugins/cfg/ConfigParser.cpp:2247:13: warning: variable ?result? set but not used [-Wunused-but-set-variable]
src/osgQt/QGraphicsViewAdapter.cpp: In member function ?bool osgQt::QGraphicsViewAdapter::handlePointerEvent(int, int, int)?:
src/osgQt/QGraphicsViewAdapter.cpp:344:17: warning: variable ?viewportGeometry? set but not used [-Wunused-but-set-variable]
examples/osgdistortion/osgdistortion.cpp: In function ?osg::Node* createDistortionSubgraph(osg::Node*, const Vec4&)?:
examples/osgdistortion/osgdistortion.cpp:125:19: warning: variable ?cursor? set but not used [-Wunused-but-set-variable]
examples/osgdistortion/osgdistortion.cpp:126:19: warning: variable ?texcoord? set but not used [-Wunused-but-set-variable]
examples/osgdistortion/osgdistortion.cpp: In function ?osg::Geometry* createDomeDistortionMesh(const Vec3&, const Vec3&, const Vec3&, osg::ArgumentParser&)?:
examples/osgdistortion/osgdistortion.cpp:358:15: warning: variable ?cursor? set but not used [-Wunused-but-set-variable]
examples/osgposter/osgposter.cpp: In function ?int main(int, char**)?:
examples/osgposter/osgposter.cpp:253:31: warning: variable ?outputTiles? set but not used [-Wunused-but-set-variable]
examples/osgthreadedterrain/osgthreadedterrain.cpp: In function ?int main(int, char**)?:
examples/osgthreadedterrain/osgthreadedterrain.cpp:669:10: warning: variable ?readParameter? set but not used [-Wunused-but-set-variable]
examples/osgtext3D/TextNode.cpp: In member function ?virtual void osgText::Layout::layout(osgText::TextNode&) const?:
examples/osgtext3D/TextNode.cpp:80:11: warning: variable ?characterHeightScale? set but not used [-Wunused-but-set-variable]
examples/osgvolume/osgvolume.cpp: In function ?int main(int, char**)?:
examples/osgvolume/osgvolume.cpp:678:38: warning: variable ?internalFormatMode? set but not used [-Wunused-but-set-variable]
examples/osgwidgetcanvas/osgwidgetcanvas.cpp: In function ?bool windowMouseOver(osgWidget::Event&)?:
examples/osgwidgetcanvas/osgwidgetcanvas.cpp:27:24: warning: variable ?xy? set but not used [-Wunused-but-set-variable]
examples/osgwidgetcanvas/osgwidgetcanvas.cpp: In function ?bool widgetMouseOver(osgWidget::Event&)?:
examples/osgwidgetcanvas/osgwidgetcanvas.cpp:35:24: warning: variable ?xy? set but not used [-Wunused-but-set-variable]
src/osgPlugins/p3d/ReaderWriterP3D.cpp: In member function ?osg::Node* ReaderWriterP3DXML::parseXmlGraph(osgDB::XmlNode*, bool, osgDB::Options*) const?:
src/osgPlugins/p3d/ReaderWriterP3D.cpp:2121:10: warning: variable ?readSlide? set but not used [-Wunused-but-set-variable]
applications/present3D/present3D.cpp: In function ?int main(int, char**)?:
applications/present3D/present3D.cpp:639:10: warning: variable ?sizesSpecified? set but not used [-Wunused-but-set-variable]
2011-06-22 12:38:53 +00:00
Robert Osfield
e9d597b392 Fixed regression in --run-on-demand feature 2011-06-22 09:06:51 +00:00
Robert Osfield
781e4e259d Merged from svn/trunk changeset r12593, Removed assert() that always evaluated to true. 2011-06-21 17:30:07 +00:00
Robert Osfield
46fa819fa1 Merged from svn/trunk, changeset 12591, From Torben Dannhauer, "originally I posted the addendum of 'freetype244MT', but that was wrong.
I updated it to the correct addendum of 'freetype244' yesterday, but supposedly that was not forwarded to you by the forum-to-mail-gateway.

Find attached the corrected CMake module. "
2011-06-21 13:03:24 +00:00
Robert Osfield
80e1adfb6c Updated ChangeLog and AUTHORS file for 3.0.0-rc2 2011-06-21 10:26:30 +00:00
Robert Osfield
ff216c2100 Merged changeset 12581 from svn/trunk to address VisualStudio warning 2011-06-21 10:07:59 +00:00
Robert Osfield
7f6938ebad Merged from svn/trunk warnings fixes provided by Changeset 12582 from Michael Platings, along with addition
of returns at ends of files and changes to tabs to four spaces.
2011-06-21 09:58:31 +00:00
Robert Osfield
1dc91aa355 Updated release candidate number 2011-06-20 19:41:39 +00:00
Robert Osfield
caa9e38d2b Merged from svn/trunk, r12574.
From Farshid Lashkari, BGR write support for BMP, PNG and TGA
2011-06-20 19:37:40 +00:00
Robert Osfield
6402710910 Merged changes to svn/trunk that address cppcheck reported issues:
[examples/osgphotoalbum/PhotoArchive.cpp:56]: (error) Memory leak: fileIndentifier
[examples/osgphotoalbum/PhotoArchive.cpp:257]: (error) Deallocating a deallocated pointer: newData
[examples/osgphotoalbum/PhotoArchive.cpp:318]: (error) Deallocating a deallocated pointer: newData
[src/osg/ImageUtils.cpp:116]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:307]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:312]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:367]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:399]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:400]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:482]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:483]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:484]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:519]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/ImageUtils.cpp:536]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:71]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:74]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:77]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:82]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:102]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:107]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:599]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:600]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:601]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:602]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:603]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:604]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:605]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osg/OcclusionQueryNode.cpp:606]: (portability) Extra qualification 'osg::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:134]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:135]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:136]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:137]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:139]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:177]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:178]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:195]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:198]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:203]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:205]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/ExternalFileWriter.cpp:253]: (portability) Extra qualification 'osgDB::' unnecessary and considered an error by many compilers.
[src/osgDB/InputStream.cpp:553]: (error) Memory leak: data
[src/osgDB/OutputStream.cpp:393]: (error) Memory leak: data
[src/osgPlugins/Inventor/ConvertToInventor.cpp:656]: (error) Mismatching allocation and deallocation: tmpArray
[src/osgPlugins/Inventor/ReaderWriterIV.cpp:237]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[src/osgPlugins/OpenFlight/expGeometryRecords.cpp:167]: (portability) Extra qualification 'flt::' unnecessary and considered an error by many compilers.
[src/osgPlugins/OpenFlight/expGeometryRecords.cpp:373]: (portability) Extra qualification 'flt::' unnecessary and considered an error by many compilers.
[src/osgPlugins/cfg/CameraConfig.cpp:635]: (error) Unusual pointer arithmetic
[src/osgPlugins/freetype/FreeTypeLibrary.cpp:122]: (error) Memory leak: buffer
[src/osgPlugins/geo/ReaderWriterGEO.cpp:210]: (error) Possible null pointer dereference: gfd - otherwise it is redundant to check if gfd is null at line 211
[src/osgPlugins/geo/ReaderWriterGEO.cpp:227]: (error) Possible null pointer dereference: gfd - otherwise it is redundant to check if gfd is null at line 228
[src/osgPlugins/geo/ReaderWriterGEO.cpp:903]: (error) Possible null pointer dereference: gfd - otherwise it is redundant to check if gfd is null at line 904
[src/osgPlugins/geo/osgGeoNodes.h:180]: (error) Memory leak: geoHeaderGeo::intVars
[src/osgPlugins/geo/osgGeoNodes.h:181]: (error) Memory leak: geoHeaderGeo::useVars
[src/osgPlugins/geo/osgGeoNodes.h:182]: (error) Memory leak: geoHeaderGeo::extVars
[src/osgPlugins/md2/ReaderWriterMD2.cpp:180]: (error) Memory leak: mapbase
[src/osgPlugins/md2/ReaderWriterMD2.cpp:166]: (error) Resource leak: file_fd
[src/osgPlugins/pic/ReaderWriterPIC.cpp:152]: (error) Mismatching allocation and deallocation: tmpbuf
[src/osgPlugins/pic/ReaderWriterPIC.cpp:153]: (error) Mismatching allocation and deallocation: buffer
[src/osgPlugins/ply/plyfile.cpp:843]: (error) Memory leak: plyfile
[src/osgPlugins/pvr/ReaderWriterPVR.cpp:179]: (error) Memory leak: imageData
[src/osgPlugins/shp/ESRIShapeParser.cpp:29]: (error) Resource leak: fd
[src/osgPlugins/shp/XBaseParser.cpp:96]: (error) Resource leak: fd
[src/osgPlugins/zip/unzip.cpp:3158]: (error) Possible null pointer dereference: s - otherwise it is redundant to check if s is null at line 3159
[src/osgPlugins/zip/unzip.cpp:4155]: (error) Dangerous usage of 'rd' (strncpy doesn't always 0-terminate it)
[src/osgShadow/MinimalCullBoundsShadowMap.cpp:334]: (error) Possible null pointer dereference: rl - otherwise it is redundant to check if rl is null at line 331
[src/osgViewer/ScreenCaptureHandler.cpp:617]: (error) Possible null pointer dereference: camera - otherwise it is redundant to check if camera is null at line 611
[src/osgViewer/ScreenCaptureHandler.cpp:632]: (error) Possible null pointer dereference: camera - otherwise it is redundant to check if camera is null at line 626
[src/osgVolume/Locator.cpp:209]: (error) Dangerous iterator usage after erase()-method.
[src/osgVolume/RayTracedTechnique.cpp:274]: (error) Possible null pointer dereference: imageLayer - otherwise it is redundant to check if imageLayer is null at line 259
[src/osgVolume/RayTracedTechnique.cpp:275]: (error) Possible null pointer dereference: imageLayer - otherwise it is redundant to check if imageLayer is null at line 259
[src/osgWrappers/serializers/osg/ShaderBinary.cpp:28]: (error) Mismatching allocation and deallocation: data
2011-06-20 19:33:47 +00:00
Robert Osfield
b087e0f952 Merged following revisions from svn/trunk which address problems with toggling fullscreen on/off under modern X11 window managers
------------------------------------------------------------------------

r12573 | robert | 2011-06-20 12:25:52 +0100 (Mon, 20 Jun 2011) | 2 lines

Added catch for window manager doesn't set the window size to full screen.

------------------------------------------------------------------------
r12572 | robert | 2011-06-20 10:28:39 +0100 (Mon, 20 Jun 2011) | 4 lines

Added check against Traits::overrideRedirct to prevent the fullscreen workaround being run when overrideRedirect
is on as overrideRedirect switches off the window managers ability to manage the fullscreen so the problem doesn't
need working around.

------------------------------------------------------------------------
r12571 | robert | 2011-06-20 10:22:57 +0100 (Mon, 20 Jun 2011) | 2 lines

Introduced a workaround for fullscreen toggle issues under modern X11 window managers.
2011-06-20 17:54:27 +00:00
Robert Osfield
98a2ec67a6 Merged from svn/trunk. Added sleep before window resizing to make it less likely that the previous frames rendering traversal is still
running when the window(s) is resized, something that creates what looks like a glitch in rendering.
2011-06-20 09:22:05 +00:00
Robert Osfield
d5d9f4c082 From Torben Dannhauer, "Just in time for OSG 3.0 I will present an updated 3rdParty package for VS2008 , which includes some updated libraries (libcurl, freetype, jpeg). It also provides now all debug databases (*.pdb), so all the annoying compile warnings about missing .pdb files are gone.
I extended the CMAKE module to find the new library."
2011-06-19 19:21:21 +00:00
Robert Osfield
a656e402b7 Reset OPENSCENEGRAPH_SVN setting to branches to enable the tags to be created on the branches rather svn/trunk. 2011-06-17 16:37:58 +00:00
Robert Osfield
f173ea4224 First cut of OpenSceneGraph-3.0 branch from svn/trunk. 2011-06-17 13:14:49 +00:00
2851 changed files with 157516 additions and 272599 deletions

View File

@@ -1,11 +0,0 @@
# CodeDocs.xyz Configuration File
DOXYFILE = doc/Doxyfiles/doxyfile.cmake
PROJECT_NUMBER =
PROJECT_LOGO = examples/osgAndroidExampleGLES1/res/drawable-hdpi/osg.png
INPUT = include
STRIP_FROM_PATH = include/
HTML_FOOTER =
SEARCHENGINE = YES

106
.gitignore vendored
View File

@@ -1,106 +0,0 @@
doc/all_Doxyfile
doc/auto_Doxyfile
doc/core_Doxyfile
doc/openscenegraph.doxyfile
doc/openthreads.doxyfile
doc/OpenSceneGraphReferenceDocs/
doc/OpenThreadsReferenceDocs/
doc/*.chm
CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
cmake_uninstall.cmake
include/OpenThreads/Config
include/OpenThreads/Version
include/osg/Config
include/osg/GL
include/osg/Version
include/osgQt/Version
src/osgQt/__
lib/
bin/
*.pc
*.conf
CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest*.txt
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Automatically generated Package files
packaging/cmake/*
configure/*
# Platform Specifics - auto generated files
PlatformSpecifics/Windows/*.rc
# Visual studio - project files
*.sln
*.suo
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
# Visual Studio - Build Results
[Dd]ebug/
[Rr]elease/
[Mm]in[Ss]ize[Rr]el/
[Rr]el[Ww]ith[Dd]eb[Ii]nfo/
# Visual Studio - Browsing Database File
*.sdf
*.opensdf
# Visual Studio - Cache/Options Directory
.vs/
.vscode/*
#osx xcode
DerivedData/
*.DS_Store
*.build
*.xcodeproj
#CPACK related files
CPackConfig-*.cmake
_CPack_Packages/
#packages
*.tar.gz
*.zip

View File

@@ -1,68 +0,0 @@
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "0ROQiFbsZo33ce2v5VjBxNljemh/HU70ntSSPygYwaDFymubts/62SixXVkbKNIFdrs3uYD6qeA/eMmpqXxLcs+PXNq5NrH7eSWw9oDIKMhq3NQH/IZLdRfXwihHimZ1qEs/TXyWlT2aC4rpBi1py3cJeTh1aBMlz4V/nm16iRAgc596ThNTuPDHa0F9/gZnwccI/Rr9VpiYn7vEBbuY9lYr43D0G3NuuQyvvlHShroH09fh6KyFOWIY38AQtnuVGNC1fIiAUk7TUqDqSBwhIrUV5saHbP0kca6DP32REkv//h4JwM76UHv+ntVEoK/UiztJHMkrw71gXYTyvIvlDBpT+IDoeIwUW2QFNQ5zJZI7FM8k0+oeK+F7k/mkffDzr1zww/PQoxqFBF0PoxAni/L9qkA4X2o1A6mRDbe9besp2LQG6Vniwj3bHpCId2QiiMrANVg0EAqkcL2mVFEaqZsh90qCkr1UDq4WQoYbXh0Fy3UnQpbuxDvCME8u03lwuv6ds/SBxc5cgKv7oWXgezaDg7/OCR+0lIAGuLqmNRD8Xw7a0WZGmSbYCHIZmeyFja2KuUvMiVCt8+QsyZr3e523DwBwnSj1BIYFRstMaSEJgu9B8rfTRRllOOKJXCQtdFVuGu8VI6PniSAkI6c535yOWzsuS8HwIkN2ll+Wn7E="
language: cpp
cache: ccache
matrix:
fast_finish: true
include:
#Linux build
- os: linux
dist: trusty
language: cpp
env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
#- LLVM_VERSION=3.8
sudo: false
cache:
apt: true
ccache: true
compiler:
#- clang
- gcc
addons:
coverity_scan:
project:
name: "openscenegraph/OpenSceneGraph"
description: "OpenSceneGraph build"
notification_email: robert@openscenegraph.com
build_command_prepend: "cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF -DBUILD_OSG_EXAMPLES=OFF ."
build_command: "make -j 4"
branch_pattern: coverity_scan
apt:
sources:
#- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
#- clang-3.8
- g++
- cmake
# # OSX build
# - os: osx
# before_install:
# - brew update
# install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
#
#
# - os: osx
# before_install:
# - brew update
# install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF -DBUILD_OSG_APPLICATIONS=OFF -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF"
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then mkdir build && cd build && travis_wait 60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../product $CMAKECMD_ARGS ../ ; fi
- if [ -f CMakeCache.txt ]; then make -j4 ; fi

View File

@@ -1,6 +1,6 @@
OpenSceneGraph Library 3.6.4
OpenSceneGraph Library 3.0.1
570 Contributors:
466 Contributors:
Firstname Surname
-----------------
@@ -8,144 +8,123 @@ Robert Osfield
Don Burns
Stephan Huber
Paul Martz
Laurens Voerman
Farshid Lashkari
Mathias Fr<46>hlich
Marco Jez
Wang Rui
Jean-S<>bastien Guay
Ulrich Hertlein
Mathias Fr<46>hlich
Mike Weiblen
Sukender
Jean-S<>bastien Guay
Farshid Lashkari
Eric Wing
Wang Rui
Ulrich Hertlein
Cedric Pinson
Brede Johansen
Bob Kuehne
Wojciech Lewandowski
Sukender
Michael Platings
Bob Kuehne
Geoff Michel
Eric Sokolowsky
Wojciech Lewandowski
David Callu
Colin McDonald
Trajce Nikolov
Tim Moore
Martin Lavery
Mattias Helsing
Jannik Heller
Jason Beverage
Tree
Pjotr Svetachov
Colin McDonald
Tree
Luigi Calori
Alberto Luaces
Mike Wittman
Jan Peciva
Chris Hanson
Roland Smeenk
Roger James
Jeremy Moles
Chris Hanson
Jason Beverage
Mattias Helsing
Jan Peciva
Andy Skinner
Paul Melis
J.P. Delport
Magnus Kessler
David Fries
Tom Jolley
Paul Melis
Jordi Torres
Luc Frauciel
Aurelien Albert
Torben Dannhauer
Pavel Moloshtan
Brad Christiansen
Terry Welsh
Olaf Flebbe
Mathieu Marache
Lionel Lagarde
Jason Daly
Art Tevs
Alberto Luaces
Philip Lowman
Per Fahlberg
Norman Vine
Chris Denham
Sherman Wilcox
Art Tevs
Serge Lages
Romano Jos<6F> Magacho da Silva
Mourad Boufarguine
Magnus Kessler
Laurens Voerman
Alberto Farre
Glenn Waldron
Terry Welsh
Sherman Wilcox
Robert Milharcic
Olaf Flebbe
Mathieu Marache
Andr<EFBFBD> Garneau
Adrian Egli
Sebastian Messerschmidt
Randall Hopper
Kristofer Tingdahl
Jan Ciger
Ruben Lopez
Robert Michael
Randall Hopper
Mourad Boufarguine
Brad Christiansen
Gideon May
Don Tidrow
Chris Denham
Stephane Lamoliatte
Romano Jos<6F> Magacho da Silva
Michael Gronager
Martin Naylor
Joakim Simonsson
David Spilling
Daniel Sj<53>lie
Bryan Thrall
Andreas Ekstrand
Rafa Gaitan
Mike Connell
Konstantin Matveyev
Glenn Waldron
Fabien Lavignotte
Thomas Hogarth
Riccardo Corsi
Torben Dannhauer
Melchior Franz
Johannes Baeuerle
Ravi Mathur
Lionel Lagarde
Jan Ciger
Rafa Gaitan
Neil Hughes
Mike Connell
Martin Beckett
Marc Helbling
Joran Jessurun
Gino van den Bergen
Frederic Marmond
David Guthrie
Csaba Halasz
Cory Riddell
Chuck Seberino
Boris Bralo
Andreas Ekstrand
Yefei He
Sondra Iverson
Simon Julier
Rune Schmidt Jensen
Ralf Habacker
Rainer Oder
Nico Kruithof
Martin Naylor
Martin Aumueller
Mario Valle
Lukasz Izdebski
Jorge Izquierdo Ciges
Luc Frauciel
Gordon Tomlinson
Frederic Marmond
Frederic Bouvier
Cory Riddell
Carlo Camporesi
Bj<EFBFBD>rn Blissing
Alexander Sinditskiy
Vladimir Chebaev
Ben Discoe
Thibault Genessay
Sasa Bistrovic
Raymond de Vries
Ravi Mathur
Ralf Habacker
Neil Groves
Mikhail Izmestev
Markus Trenkwalder
Loic Dachary
Joseph Steel
Jorge Izquierdo
John Shue
Hartwig Wiesmann
Johannes Baeuerle
Chuck Seberino
Brad Colbert
Ben Discoe
Vivek Rajan
Uwe Woessner
Tony Horrobin
Thom DeCarlo
Tatsuhiro Nishioka
Tanguy Fautr<74>
Sean Spicer
Ryan Kawicki
Richard Schmidt
Peter Hrenka
Paul de Repentigny
@@ -155,139 +134,120 @@ Mihai Radu
Michael Hartman
Martins Innus
Maciej Krol
Lilin Xiong
Leandro Motta Barros
Julien Valentin
Johan Nouvel
Javier Taibo
Hartwig Wiesmann
Frederic Bouvier
Donn Mielcarek
Corbin Holtz
Blasius Czink
Alexander Irion
Wee See
Toshiyuki Takahei
Tony Horrobin
Sebastien Grignard
Rudolf Wiedemann
Ryan Kawicki
Romano Magacho
Riccardo Corsi
Nico Kruithof
Mikhail Izmestev
Maria Ten
Liang Aibin
Leandro Motta Barros
Katharina Plugge
John Vidar Larring
John Kelso
John Ivar
Gustav Haapalahti
Erik den Dekker
Emmanuel Roche
Domenico Mangieri
Daniel Larimer
Colin Dunlop
Bruce Clay
Bradley Anderegg
Andreas Goebel
Alok Priyadarshi
Ali Botorabi
Alexander Irion
Alberto Barbati
Alan Dickinson
Vladimir Shabanov
Tugkan Calapoglu
Tim Daoust
Sylvain Marie
Thomas Hogarth
Sohey Yamamoto
Sergey Leontyev
Santosh Gaikwad
Ryan Pavlik
Robert Milharcic
Rudolf Wiedemann
Rene Molenaar
Piotr Domagalski
Philippe Renon
Phil Atkin
Pawel Ksiezopolski
Patrick Neary
Nathan Monteleone
Miha Rav<61>elj
Miguel Escriva
Mattias Linde
Mark Sciabica
Marcin Prus
Lilin Xiong
Lee Butler
Lars Nilsson
Konstantin Sinitsyn
Ken Sewell
Julian Ortiz
Julen Garcia
John Kaniarz
Johannes Scholz
Jim Vaughan
Jeremy Bell
Jaromir Vitek
James French
Jaap Glas
Guillaume Millet
Gary Quinn
Garrett Potts
Gabor Dorka
Fabio Mierlo
Erik den Dekker
Doug McCorkle
Donald Cipperly
Don Leich
Dietmar Funck
Colin Cochran
Christian Ruzicka
Christian Buchner
Chris Djali
Domenico Mangieri
Charles Cole
Blake Williams
Bj<EFBFBD>rn Hein
Aur<EFBFBD>lien Chatelain
Antoine Hue
Andrew Bettison
Andreas Henne
Anders Backman
Ali Botorabi
Alexander Wiebel
Alessandro Terenzi
Alberto Barbati
Zach Deedler
Yuzhong Shen
Warren Macchi
Vincent Bourdier
Terrex
Terrex
Tassilo Glander
Sylvain Marie
Steve Lunsford
Stephane Simon
Stephan Eilemann
Stanislav Blinov
Sergey Polischuk
Roni Zanolli
Sebastian Messerschmidt
Raymond de Vries
Ralf Kern
Piotr Gwiazdowski
Pierre Haritchabalet
Perry Miller
Paul Palumbo
Paul Obermeier
Nguyen Van Truong
Nathan Cournia
Morten Haukness
Morn<EFBFBD> Pistorius
Michael Mc Donnell
Michael Henheffer
Michael Guerrero
Maya Leonard
Max Bandazian
Mathias Fiedler
Mathew May
Martin von Gargern
Martin Spott
Martin Lambers
Martijn Kragtwijk
Marius Heise
Marcin Hajder
Marcel Pursche
Lukasz Izdebski
Lilith Bryant
Lars Nilsson
Kevin Moiule
Keith Steffen
Julen Garcia
Joseph Winston
John Aughey
Joachim Pouderoux
Jean-Christophe Lombardo
Jan Klimke
James Turner
Javier Taibo
James Moliere
Igor Kravtchenko
Himar Carmona
@@ -296,37 +256,28 @@ Guy Volckaert
Gustavo Wagner
Guillaume Taze
Guillaume Chouvenc
Giuseppe Donvito
Gill Peacegood
Giampaolo Vigan<61>
Gerrick Bivins
George Tarantilis
Ferdi Smit
Eric Buehler
Eduardo Poyart
Edgar Ellis
Dmitry Marakasov
Dimi Christopoulos
Diane Delall<6C>e
David Longest
Dietmar Funck
David Ergo
Daniel Trstenjak
Craig Bosma
Claus Scheiblauer
Christophe Loustaunau
Christian Kehl
Bradley Baker Searles
Brad Anderegg
Aric Aumann
Anish Thomas
Andrew Sampson
Andrew Lorino
Alexandre Amalric
Aitor Moreno
Alessandro Terenzi
Zbigniew Sroczynski
Yuri Vilmanis
Xin Li
Wang Lam
Wand Rui
Walter J. Altice
Volker Walkiewicz
Vladimir Vukicevic
@@ -336,50 +287,36 @@ Vincent Vivanloc
Vincent Gadoury
Vasily Radostev
Valery Bickov
Valeriy Dubov
Vaclav Bilek
Tyge L<>vset
Troy Yee
Torben Dannahauer
Tony Vasile
Tomas Hogarth
Tomas Hnilica
Todd Furlong
Tobias Ottenweller
Tino Schwarze
Tim George
Thorsten Brehm
Thomas Weidner
Tan Dunning
Tamer Fahmy
Stewart Andreason
Steven Thomas
Stephan Wenglorz
Simon Hammett
Simon Carmody
Simon Buckley
Sid Byce
Shuxing Xiao
Shane Arnott
Sergey Kurdakov
Sebastien Kuntz
Sandro Mani
Ruth Lang
Ruben The
Ruben Smelik
Ross Anderson
Ronny Krueger
Ronald van Maarseveen
Romain Ouabdelkader
Romain Charbit
Rocco Martino
Robert Swain
Rob Smith
Rob Radtke
Rob Bloemkool
Rick Pingry
Rick Appleton
Remo Eichenberger
Reinhard Sainitzer
Rein Kadijk
Ragnar Hammarqvist
@@ -393,39 +330,26 @@ Philip Lamb
Petr Salinger
Peter Bear
Peter Amstutz
Per Nordqvist
Paul Idstein
Paul Palumbo
Paul Fredrikson
Paul Fotheringham
Paul Cheyrou-Lagreze
Pau Garcia
Patrick Hartling
Parag Chaudhur
Panagiotis Papadakos
Panagiotis Koutsourakis
Orhun Birsoy
Oren Fromberg
Oliver Neumann
Ole-Morten Duesund
Ognjen Kostic
Nicolas Brodu
Nick Thu
Nick Black
Morten Haukness
Mojtaba Fathi
Mirko Viviani
Mikkel Gj<EFBFBD>l
Mike Krus
Mikkel Gjøl
Mike Garrity
Mick Thu
Michal Durkovic
Michael Schanne
Michael Polak
Michael Morrison
Michael Logan
Michael Kapelko
Michael Bach Jensen
Maya Thu
Maya Leonard
Max Rhiener
Max Behensky
Mauricio Hofmam
@@ -436,81 +360,66 @@ Matt Burke
Mathias Walker
Mathias Goldau
Mason Menninger
Martin von Gargern
Martin Scheffler
Martin Lambers
Martin Innus
Martin Beck
Marius Kintel
Mario Guimaraes
Marcus Hein
Marco Thu
Marco Sciabica
Marco Lehmann
Marcin Prus
Maik Keller
Lukas Diduch
Louis Hamilton
Likasz Izebski
Lewis Harmon
Leigh Stivers
Laurence Muller
Laura Cerritelli
Kyle Centers
Kristopher Bixler
Konstantin Matveyev
Kim Seokhwan
Kim Bale
Karsten Weiss
Karl Heijdenberg
Jutta Sauer
Julian Scheid
Juergen Rensen
Juan Manuel Alvarez
Juan Hernando
Josh Portway
Jonathan Greig
John Tan
John Hedström
John Grant
John Farrier
John Donovan
John Davis
John Cummings
John Argentieri
Joe Thompson
Joan Abadie
Jim Brooks
Jeroen den Dekker
Jeffrey Kinross
Jay Zuckerman
Jason Howlett
Jason Ballenger
Jamie Robertson
Jan Klimke
James Killian
James Athey
J.E. Hoffmann
Holger Helmich
Henrique Bucher
Hautio Jari
Hartmut Seichter
Gunter Huber
Guillaume Millet
Gregory Jaegy
Graeme Harkness
Gian Lorenzetto
George Papagiannakis
Geoff Thu
Galen Faidley
Frida Schlaug
Frederic Smith
Frederic Morin
Frank Warmerdam
Frank Midgley
Frank Lindeman
Frank Lichtenheld
Francois Tigeot
Filip Arlet
Ferdinand Cornelissen
Fajran Iman
Fabien Dachicourt
Erik Johnson
Eric Thu
Eric Buehler
Eduardo Alberto
Edmond Gheury
Ed Ralston
@@ -518,7 +427,6 @@ Duvan Cope
Duncan Cavens
Drew Whitehouse
Douglas A. Pouk
Dmitriy Ogalcev
Dean Iverson
David Jung
Danny Valente
@@ -526,27 +434,21 @@ Daniel Stien
Dan Minor
C<EFBFBD>sar L. B. Silveira
Cyril Brulebois
Curtis Rubel
Cory Slep
Cl<EFBFBD>ment B<>sch
Clay Fowler
Claus Steuer
Claus Scheiblauer
Chuck Sembroski
Christopher Blaesius
Christopher Baker
Christophe Herreman
Christian Noon
Christian Kaser
Christian Ehrlicher
Chris White
Christian Buchner
Chris McGlone
Carlos Garcea
Capostrophic
Bryce Eldridge
Bruno Herbelin
Brian Keener
Brede Thu
Brandon Hamm
Bora Utka
Bj<EFBFBD>rn Hein
Bill Prendergast
Bernardt Duvenhage
Benoit Laniel
@@ -554,23 +456,17 @@ Benjamin Wasty
Ben van Basten
Bart Gallet
Axel Volley
Arjun Ramamurthy
Anthousis Andreadis
Anna Sokol
Andy Preece
Andrew Reyonolds
Andreas Roth
Andreas Jochens
Andre Normann
Alois Wismer
Almalric Alexandre
Allen Bierbaum
Alexey Pavlov
Alexander Sinditskiy
Alberto Jaspe
Alan Purvis
Alan Ott
Alan Harris
Adrien Grandemange
Adrian Clark
Adam Richard
Abhishek Bansal

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# Check for availability of atomic operations
# Check for availability of atomic operations
# This module defines
# OPENTHREADS_HAVE_ATOMIC_OPS
@@ -15,143 +15,123 @@ IF (OPENTHREADS_ATOMIC_USE_MUTEX)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ELSE()
# as the test does not work for IOS hardcode the ATOMIC implementation
IF(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR OR OSG_BUILD_PLATFORM_IPHONE)
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 0)
SET(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS 0)
SET(_OPENTHREADS_ATOMIC_USE_SUN 0)
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 0)
SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 1)
INCLUDE(CheckCXXSourceRuns)
ELSE()
INCLUDE(CheckCXXSourceRuns)
# Do step by step checking,
CHECK_CXX_SOURCE_RUNS("
#include <cstdlib>
# Do step by step checking,
CHECK_CXX_SOURCE_RUNS("
#include <cstdlib>
int main()
{
unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
int main()
{
unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
return EXIT_FAILURE;
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
CHECK_CXX_SOURCE_RUNS("
#include <stdlib.h>
CHECK_CXX_SOURCE_RUNS("
#include <stdlib.h>
int main(int, const char**)
{
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
int main(int, const char**)
{
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
return EXIT_FAILURE;
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
CHECK_CXX_SOURCE_RUNS("
#include <atomic.h>
#include <cstdlib>
CHECK_CXX_SOURCE_RUNS("
#include <atomic.h>
#include <cstdlib>
int main(int, const char**)
{
uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
int main(int, const char**)
{
uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
return EXIT_FAILURE;
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_SUN)
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_SUN)
CHECK_CXX_SOURCE_RUNS("
#include <windows.h>
#include <intrin.h>
#include <cstdlib>
CHECK_CXX_SOURCE_RUNS("
#include <windows.h>
#include <intrin.h>
#include <cstdlib>
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
int main(int, const char**)
{
volatile long value = 0;
long data = 0;
long* volatile ptr = &data;
int main(int, const char**)
{
volatile long value = 0;
long data = 0;
long* volatile ptr = &data;
InterlockedIncrement(&value);
MemoryBarrier();
InterlockedDecrement(&value);
InterlockedIncrement(&value);
MemoryBarrier();
InterlockedDecrement(&value);
if (0 != InterlockedCompareExchange(&value, 1, 0))
return EXIT_FAILURE;
if (0 != InterlockedCompareExchange(&value, 1, 0))
return EXIT_FAILURE;
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE;
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
CHECK_CXX_SOURCE_RUNS("
#include <libkern/OSAtomic.h>
CHECK_CXX_SOURCE_RUNS("
#include <libkern/OSAtomic.h>
int main()
{
volatile int32_t value = 0;
long data = 0;
long * volatile ptr = &data;
int main()
{
volatile int32_t value = 0;
long data = 0;
long * volatile ptr = &data;
OSAtomicIncrement32(&value);
OSMemoryBarrier();
OSAtomicDecrement32(&value);
OSAtomicCompareAndSwapInt(value, 1, &value);
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF()
# MinGW can set both WIN32_INTERLOCKED and GCC_BUILTINS to true which results in compliation errors
IF (_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
# In this case we prefer the GCC_BUILTINS
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 1)
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
ENDIF()
OSAtomicIncrement32(&value);
OSMemoryBarrier();
OSAtomicDecrement32(&value);
OSAtomicCompareAndSwapInt(value, 1, &value);
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF()
ENDIF()

View File

@@ -9,19 +9,19 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
SET(MY_PATH_INCLUDE )
SET(MY_PATH_LIB )
FOREACH( MYPATH ${SEARCHPATHLIST} )
SET(MY_PATH_INCLUDE ${MY_PATH_INCLUDE} ${MYPATH}/include)
SET(MY_PATH_LIB ${MY_PATH_LIB} ${MYPATH}/lib)
ENDFOREACH( MYPATH ${SEARCHPATHLIST} )
FIND_PATH("${DEPNAME}_INCLUDE_DIR" ${INCLUDEFILE}
${MY_PATH_INCLUDE}
NO_DEFAULT_PATH
)
MARK_AS_ADVANCED("${DEPNAME}_INCLUDE_DIR")
#MESSAGE( " ${DEPNAME}_INCLUDE_DIR --> ${${DEPNAME}_INCLUDE_DIR}<--")
SET(LIBRARY_NAMES "")
FOREACH(LIBNAME ${LIBRARY_NAMES_BASE})
LIST(APPEND LIBRARY_NAMES "${LIBNAME}${EXSUFFIX}")
@@ -35,7 +35,7 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
FOREACH(LIBNAME ${LIBRARY_NAMES_BASE})
LIST(APPEND LIBRARY_NAMES_DEBUG "${LIBNAME}${DEBUGSUFFIX}${EXSUFFIX}")
ENDFOREACH(LIBNAME)
FIND_LIBRARY("${DEPNAME}_LIBRARY_DEBUG"
FIND_LIBRARY("${DEPNAME}_LIBRARY_DEBUG"
NAMES ${LIBRARY_NAMES_DEBUG}
PATHS ${MY_PATH_LIB}
NO_DEFAULT_PATH
@@ -49,59 +49,51 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
MESSAGE("-- Warning Debug ${DEPNAME} not found, using: ${${DEPNAME}_LIBRARY}")
SET(${DEPNAME}_LIBRARY_DEBUG "${${DEPNAME}_LIBRARY}")
ENDIF(NOT ${DEPNAME}_LIBRARY_DEBUG)
SET(${DEPNAME}_LIBRARIES debug ${${DEPNAME}_LIBRARY_DEBUG} optimized ${${DEPNAME}_LIBRARY} )
ENDIF(${DEPNAME}_INCLUDE_DIR AND ${DEPNAME}_LIBRARY)
ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX)
################################################################################################
# this Macro is tailored to Mike and Torbens dependencies
# this Macro is tailored to Mike dependencies
################################################################################################
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
FIND_DEPENDENCY(TIFF tiff.h "libtiff;tiff" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;freetype250;freetype27;freetype271;" ${OSG_3RDPARTY_BIN} "d" "")
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i")
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;" ${OSG_3RDPARTY_BIN} "d" "")
IF(FREETYPE_FOUND)
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
SET(FREETYPE_INCLUDE_DIR_freetype2 ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_FOUND)
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib;libcurl_imp" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(JPEG jpeglib.h "libjpeg;jpeg" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(GDAL gdal.h "gdal;gdal16" ${OSG_3RDPARTY_BIN} "d" "_i")
FIND_DEPENDENCY(GLUT GL/glut.h glut32 ${OSG_3RDPARTY_BIN} "D" "")
IF(GLUT_FOUND)
#forcing subsequent FindGlut stuff to not search for other variables.... kind of a hack
#forcing subsequent FindGlut stuff to not search for other variables.... kind of a hack
SET(GLUT_glut_LIBRARY ${GLUT_LIBRARY} CACHE FILEPATH "")
MARK_AS_ADVANCED(GLUT_glut_LIBRARY)
ENDIF(GLUT_FOUND)
FIND_DEPENDENCY(GIFLIB gif_lib.h "ungif;libungif;giflib" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(ZLIB zlib.h "z;zlib;zlib1" ${OSG_3RDPARTY_BIN} "D" "")
IF(ZLIB_FOUND)
FIND_DEPENDENCY(PNG png.h "libpng;libpng13;libpng15;libpng16" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(PNG png.h "libpng;libpng13;libpng15" ${OSG_3RDPARTY_BIN} "D" "")
IF(PNG_FOUND)
#forcing subsequent FindPNG stuff to not search for other variables.... kind of a hack
#forcing subsequent FindPNG stuff to not search for other variables.... kind of a hack
SET(PNG_PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE FILEPATH "")
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
ENDIF(PNG_FOUND)
ENDIF(ZLIB_FOUND)
# CMakes default module to find libxml2 will not find the in
FIND_DEPENDENCY(LIBXML2 libxml/xpath.h "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(LIBXML2 libxml "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
IF(LIBXML2_FOUND)
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "LibXML2 library for collada" FORCE)
# SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
ENDIF(LIBXML2_FOUND)
#FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX)
FIND_Package(NVTT)
FIND_Package(NVTT)
#luigi#INCLUDE(FindOSGDepends.cmake)
ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
@@ -112,7 +104,7 @@ ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
# this is code for handling optional 3RDPARTY usage
################################################################################################
OPTION(USE_3RDPARTY_BIN "Set to ON to use Mike or Torbens prebuilt dependencies situated side of OpenSceneGraph source. Use OFF for avoiding." ON)
OPTION(USE_3RDPARTY_BIN "Set to ON to use Mike prebuilt dependencies situated side of OpenSceneGraph source. Use OFF for avoiding." ON)
IF(USE_3RDPARTY_BIN)
# Check Architecture
@@ -140,7 +132,7 @@ IF(USE_3RDPARTY_BIN)
SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdParty_win32binaries_vs90sp1")
ENDIF()
ENDIF(NOT EXISTS ${TEST_3RDPARTY_DIR})
SET(ACTUAL_3RDPARTY_DIR "${TEST_3RDPARTY_DIR}" CACHE PATH "Location of 3rdparty dependencies")
SET(ACTUAL_3DPARTY_DIR "${ACTUAL_3RDPARTY_DIR}") # kept for backcompatibility
IF(EXISTS ${ACTUAL_3RDPARTY_DIR})

View File

@@ -1,38 +0,0 @@
# Locate Apple AVFoundation (next-generation QTKit)
# This module defines
# AV_FOUNDATION_LIBRARY
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
#
# $AV_FOUNDATION_DIR is an environment variable that would
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
#
# Created by Stephan Maximilian Huber
IF(APPLE)
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
ENDIF()
SET(AV_FOUNDATION_FOUND "NO")
IF(AV_FOUNDATION_LIBRARY)
SET(AV_FOUNDATION_FOUND "YES")
ENDIF()
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
# AVFoundation exists ON iOS, too -- good support for SDK 6.0 and greater
IF(${IPHONE_SDKVER} LESS "6.0")
SET(AV_FOUNDATION_FOUND "NO")
ELSE()
SET(AV_FOUNDATION_FOUND "YES")
ENDIF()
ELSE()
IF(APPLE)
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
# so check the SDK-setting
IF(OSG_OSX_VERSION VERSION_LESS 10.8)
MESSAGE("AVFoundation disabled for SDK < 10.8")
SET(AV_FOUNDATION_FOUND "NO")
ENDIF()
ENDIF()
ENDIF()

View File

@@ -1,34 +0,0 @@
# Locate ASIO-headers (http://think-async.com/Asio)
# This module defines
# ASIO_FOUND, if false, do not try to link to gdal
# ASIO_INCLUDE_DIR, where to find the headers
#
# Created by Stephan Maximilian Huber
FIND_PATH(ASIO_INCLUDE_DIR
NAMES
asio.hpp
PATHS
/usr/include
/usr/local/include
)
SET(ASIO_FOUND "NO")
IF(ASIO_INCLUDE_DIR)
set(ASIO_VERSION_H ${ASIO_INCLUDE_DIR}/asio/version.hpp)
file(STRINGS ${ASIO_VERSION_H} AsioVersionLine REGEX "^#define ASIO_VERSION ")
string(REGEX MATCHALL "[0-9]+" AsioHeaderVersionMatches "${AsioVersionLine}")
list(GET AsioHeaderVersionMatches 0 AsioHeaderVersion)
# check version is less than 1.14.0 otherwise API changes break build
if (${AsioHeaderVersion} LESS "101400")
FIND_PACKAGE( Boost 1.37 )
IF(Boost_FOUND)
SET(ASIO_FOUND "YES")
ENDIF()
else()
message("ASIO not compatible")
endif()
ENDIF()

View File

@@ -11,53 +11,30 @@
# $COLLADA_DIR is an environment variable that would
# correspond to the ./configure --prefix=$COLLADA_DIR
#
# Created by Robert Osfield.
# Created by Robert Osfield.
# Check if COLLADA_DIR is set, otherwise use ACTUAL_3DPARTY_DIR:
SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} )
IF ( COLLADA_ENV_VAR_AVAILABLE )
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
ELSE ()
ELSE ( COLLADA_ENV_VAR_AVAILABLE )
SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
ENDIF()
ENDIF( COLLADA_ENV_VAR_AVAILABLE )
IF(APPLE)
SET(COLLADA_BUILDNAME "mac")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF(MINGW)
SET(COLLADA_BUILDNAME "mingw")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF((MSVC_VERSION GREATER 1910) OR (MSVC_VERSION EQUAL 1910))
SET(COLLADA_BUILDNAME "vc14")
SET(COLLADA_BOOST_BUILDNAME "vc141")
ELSEIF(MSVC_VERSION EQUAL 1900)
SET(COLLADA_BUILDNAME "vc14")
SET(COLLADA_BOOST_BUILDNAME "vc140")
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(COLLADA_BUILDNAME "vc12")
SET(COLLADA_BOOST_BUILDNAME "vc120")
ELSEIF(MSVC_VERSION EQUAL 1700)
SET(COLLADA_BUILDNAME "vc11")
SET(COLLADA_BOOST_BUILDNAME "vc110")
ELSEIF(MSVC_VERSION EQUAL 1600)
SET(COLLADA_BUILDNAME "vc10")
SET(COLLADA_BOOST_BUILDNAME "vc100")
ELSEIF(MSVC_VERSION EQUAL 1500)
ELSEIF(MSVC90)
SET(COLLADA_BUILDNAME "vc9")
SET(COLLADA_BOOST_BUILDNAME "vc90")
ELSEIF(MSVC_VERSION EQUAL 1400)
ELSEIF(MSVC80)
SET(COLLADA_BUILDNAME "vc8")
SET(COLLADA_BOOST_BUILDNAME "vc80")
ELSE()
ELSE(APPLE)
SET(COLLADA_BUILDNAME "linux")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ENDIF()
IF(${CMAKE_VS_PLATFORM_TOOLSET})
string(REPLACE "v" "vc" COLLADA_BOOST_BUILDNAME ${CMAKE_VS_PLATFORM_TOOLSET})
ENDIF()
ENDIF(APPLE)
FIND_PATH(COLLADA_INCLUDE_DIR dae.h
@@ -70,19 +47,9 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
/usr/local/include
/usr/local/include/colladadom
/usr/local/include/collada-dom
/usr/local/include/collada-dom2.5
/usr/local/include/collada-dom2.4
/usr/local/include/collada-dom2.2
/opt/local/include/collada-dom
/opt/local/include/collada-dom2.5
/opt/local/include/collada-dom2.4
/opt/local/include/collada-dom2.2
/usr/include/
/usr/include/colladadom
/usr/include/collada-dom
/usr/include/collada-dom2.5
/usr/include/collada-dom2.4
/usr/include/collada-dom2.2
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
@@ -91,17 +58,16 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
${ACTUAL_3DPARTY_DIR}/include
)
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.5-dp collada-dom2.5-dp-${COLLADA_BOOST_BUILDNAME}-mt collada-dom2.4-dp collada-dom2.4-dp-${COLLADA_BOOST_BUILDNAME}-mt
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22
PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
${COLLADA_DOM_ROOT}
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
$ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg
$ENV{COLLADA_DIR}
~/Library/Frameworks
/Library/Frameworks
/Library/Frameworks
/opt/local/Library/Frameworks #macports
/usr/local/lib
/usr/local/lib64
@@ -115,11 +81,10 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
${ACTUAL_3DPARTY_DIR}/lib
)
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d collada-dom2.5-dp-d collada-dom2.5-dp-${COLLADA_BOOST_BUILDNAME}-mt-d collada-dom2.4-dp-d collada-dom2.4-dp-${COLLADA_BOOST_BUILDNAME}-mt-d
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d
PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
${COLLADA_DOM_ROOT}
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
$ENV{COLLADA_DIR}/lib
$ENV{COLLADA_DIR}/lib-dbg
@@ -139,7 +104,7 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
${ACTUAL_3DPARTY_DIR}/lib
)
FIND_LIBRARY(COLLADA_STATIC_LIBRARY
FIND_LIBRARY(COLLADA_STATIC_LIBRARY
NAMES libcollada14dom21-s libcollada14dom22-s libcollada14dom.a
PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
@@ -162,7 +127,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY
${ACTUAL_3DPARTY_DIR}/lib
)
FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
NAMES collada_dom-sd collada14dom-sd libcollada14dom21-sd libcollada14dom22-sd libcollada14dom-d.a
PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
@@ -201,19 +166,10 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
ENDIF(WIN32)
ENDIF(LIBXML2_FOUND)
FIND_PACKAGE(ZLIB)
IF (ZLIB_FOUND)
IF (ZLIB_LIBRARY_RELEASE)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY_RELEASE}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_LIBRARY_RELEASE)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ENDIF(ZLIB_LIBRARY_RELEASE)
IF (ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY_DEBUG "${ZLIB_LIBRARY_DEBUG}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY_DEBUG "${COLLADA_ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ENDIF(ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_FOUND)
IF(WIN32)
FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
@@ -279,7 +235,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_54 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_55 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_58 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_62 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_63
NAMES libboost_filesystem boost_filesystem libboost_filesystem-vc90-mt libboost_filesystem-vc100-mt
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -287,7 +243,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_54 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_55 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_58 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_62 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_63
NAMES libboost_filesystem-d boost_filesystem-d libboost_filesystem-vc90-mt-gd libboost_filesystem-vc100-mt-gd
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -295,7 +251,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BOOST_BUILDNAME}-mt libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_54 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_55 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_58 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_62 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_63
NAMES libboost_system boost_system libboost_system-vc90-mt libboost_system-vc100-mt
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -303,7 +259,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_54 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_55 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_58 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_62 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_63
NAMES libboost_system-d boost_system-d libboost_system-vc90-mt-gd libboost_system-vc100-mt-gd
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -314,20 +270,6 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
SET(COLLADA_FOUND "NO")
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
IF (COLLADA_INCLUDE_DIR)
SET(COLLADA_FOUND "YES")
FIND_PATH(COLLADA_INCLUDE_DOMANY_DIR 1.4/dom/domAny.h
${COLLADA_INCLUDE_DIR}
)
IF (COLLADA_INCLUDE_DOMANY_DIR)
SET(COLLADA_DOM_2_4_OR_LATER TRUE)
ELSEIF()
SET(COLLADA_DOM_2_4_OR_LATER FALSE)
ENDIF()
ENDIF()
ENDIF()
ENDIF(COLLADA_INCLUDE_DIR)
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)

View File

@@ -1,23 +0,0 @@
# Locate Apple CoreMedia
# This module defines
# COREMEDIA_LIBRARY
# COREMEDIA_FOUND, if false, do not try to link to gdal
# COREMEDIA_INCLUDE_DIR, where to find the headers
#
# $COREMEDIA_DIR is an environment variable that would
# correspond to the ./configure --prefix=$COREMEDIA_DIR
#
# Created by Stephan Maximilian Huber.
IF(APPLE)
FIND_PATH(COREMEDIA_INCLUDE_DIR CoreMedia/CoreMedia.h)
FIND_LIBRARY(COREMEDIA_LIBRARY CoreMedia)
ENDIF()
SET(COREMEDIA_FOUND "NO")
IF(COREMEDIA_LIBRARY AND COREMEDIA_INCLUDE_DIR)
SET(COREMEDIA_FOUND "YES")
ENDIF()

View File

@@ -1,33 +0,0 @@
# Finds EGL header and library
#
# This script defines the following:
# EGL_FOUND // Set to TRUE if EGL is found
# EGL_INCLUDE_DIR // Parent directory of directory EGL/egl.h header.
#
# EGL_DIR can be set as an environment variable or a CMake variable,
# to the parent directory of the EGL header.
#
FIND_PATH( EGL_INCLUDE_DIR
NAMES EGL/egl.h
HINTS ENV EGL_DIR
)
FIND_LIBRARY(EGL_LIBRARY
NAMES EGL
HINTS ENV EGL_DIR
PATH_SUFFIXES lib
)
# handle the QUIETLY and REQUIRED arguments and set
# EGL_FOUND to TRUE as appropriate
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL
REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR)
MARK_AS_ADVANCED(
EGL_INCLUDE_DIR
EGL_LIBRARY
)

View File

@@ -9,109 +9,42 @@
# correspond to the ./configure --prefix=$FBX_DIR
IF(APPLE)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
SET(FBX_LIBDIR "clang")
else()
SET(FBX_LIBDIR "gcc4/ub")
endif()
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBDIR "gcc4")
ELSEIF(MSVC80)
SET(FBX_LIBDIR "vs2005")
ELSEIF(MSVC90)
SET(FBX_LIBDIR "vs2008")
ELSEIF(MSVC10)
ELSEIF(MSVC10 OR MSVC_VERSION>1600)
SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11)
SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(FBX_LIBDIR "vs2013")
ELSEIF(MSVC_VERSION EQUAL 1900)
SET(FBX_LIBDIR "vs2015")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
SET(FBX_LIBDIR "vs2017")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
# SET(FBX_LIBDIR "vs2019") # FBX doesn't have this yet as of version 2020.0.1
SET(FBX_LIBDIR "vs2017") # Binary compatible with vs2019
ENDIF()
IF(APPLE)
# do nothing
ELSEIF(CMAKE_CL_64)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
ENDIF()
#try to use 2015.1 or 2014.2 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk")
SET(FBX_LIBNAME "fbxsdk-2012.1-static")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk")
SET(FBX_LIBNAME "fbxsdk-2012.1-static")
ELSE()
OPTION(FBX_SHARED OFF)
IF(FBX_SHARED)
SET(FBX_LIBNAME "libfbxsdk")
ELSE()
SET(FBX_LIBNAME "libfbxsdk-md")
IF(WIN32)
SET(FBX_XML2_LIBNAME "libxml2-md")
SET(FBX_ZLIB_LIBNAME "zlib-md")
ENDIF()
ENDIF()
SET(FBX_LIBNAME "fbxsdk-2012.1-md")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0.1"
"/Applications/Autodesk/FBX SDK/2020.0.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0"
"/Applications/Autodesk/FBX SDK/2020.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.5"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.5"
"/Applications/Autodesk/FBX SDK/2019.5"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.2"
"/Applications/Autodesk/FBX SDK/2019.2"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
"/Applications/Autodesk/FBX SDK/2019.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
"/Applications/Autodesk/FBX SDK/2018.1.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.0"
"/Applications/Autodesk/FBX SDK/2018.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
"/Applications/Autodesk/FBX SDK/2017.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.0"
"/Applications/Autodesk/FBX SDK/2017.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2"
"/Applications/Autodesk/FBX/FBX SDK/2016.1.2"
/Applications/Autodesk/FBXSDK201612
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
"/Applications/Autodesk/FBX/FBX SDK/2016.1.1"
/Applications/Autodesk/FBXSDK201611
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
/Applications/Autodesk/FBXSDK20151
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
"/Applications/Autodesk/FBX/FBX SDK/2014.2"
/Applications/Autodesk/FBXSDK20142
$ENV{ProgramW6432}/Autodesk/FBX/FbxSdk/2012.1
$ENV{PROGRAMFILES}/Autodesk/FBX/FbxSdk/2012.1
/Applications/Autodesk/FBXSDK20121
)
# search for headers & debug/release libraries
@@ -120,113 +53,13 @@ FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
PATH_SUFFIXES "include")
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
#Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
#no debug d suffix, search in debug folder only
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(WIN32)
FIND_LIBRARY( FBX_XML2_LIBRARY ${FBX_XML2_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_ZLIB_LIBRARY ${FBX_ZLIB_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_XML2_LIBRARY_DEBUG ${FBX_XML2_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
FIND_LIBRARY( FBX_ZLIB_LIBRARY_DEBUG ${FBX_ZLIB_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
ENDIF()
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES")
ELSE()
SET(FBX_FOUND "NO")
ENDIF()
IF(NOT FBX_FOUND)
#try to use 2014.1 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk-2014.1")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk-2014.1")
ELSE()
SET(FBX_LIBNAME "fbxsdk-2014.1")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1"
"/Applications/Autodesk/FBX/FBX SDK/2014.1"
/Applications/Autodesk/FBXSDK20141
)
# search for headers & debug/release libraries
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "include")
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES")
ELSE()
SET(FBX_FOUND "NO")
ENDIF()
ENDIF()
IF(NOT FBX_FOUND)
#try to use 2013.3 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSE()
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3"
"/Applications/Autodesk/FBX/FBX SDK/2013.3"
/Applications/Autodesk/FBXSDK20133
)
# search for headers & debug/release libraries
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "include")
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES")
ELSE()
SET(FBX_FOUND "NO")
ENDIF()
ENDIF()

View File

@@ -11,11 +11,10 @@
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
#In OSG ffmpeg plugin, we used "#include <header.h>" for compatibility with old version of ffmpeg
#With the new version of FFmpeg, a file named "time.h" was added that breaks compatibility with the old version of ffmpeg.
#In OSG ffmpeg plugin, we use "#include <header.h>" for compatibility with old version of ffmpeg
#We have to search the path which contain the header.h (useful for old version)
#and search the path which contain the libname/header.h (useful for new version)
#We have to search the path which contain the header.h (usefull for old version)
#and search the path which contain the libname/header.h (usefull for new version)
#Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code)
# (in new version case, use by ffmpeg header)
@@ -32,8 +31,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
PATHS
${FFMPEG_ROOT}/include
$ENV{FFMPEG_DIR}/include
${FFMPEG_ROOT}
$ENV{FFMPEG_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
@@ -51,8 +48,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
PATHS
${FFMPEG_ROOT}/include
$ENV{FFMPEG_DIR}/include
${FFMPEG_ROOT}
$ENV{FFMPEG_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
@@ -71,8 +66,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
PATHS
${FFMPEG_ROOT}/lib
$ENV{FFMPEG_DIR}/lib
${FFMPEG_ROOT}/lib${shortname}
$ENV{FFMPEG_DIR}/lib${shortname}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
@@ -96,7 +89,7 @@ ENDMACRO(FFMPEG_FIND)
SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
# find stdint.h
IF(MSVC)
IF(WIN32)
FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
PATHS
@@ -129,29 +122,29 @@ FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
FFMPEG_FIND(LIBSWRESAMPLE swresample swresample.h)
FFMPEG_FIND(LIBAVRESAMPLE avresample avresample.h)
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
SET(FFMPEG_FOUND "NO")
# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK
AND ( FFMPEG_LIBSWRESAMPLE_FOUND OR FFMPEG_LIBAVRESAMPLE_FOUND ) )
IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK)
SET(FFMPEG_FOUND "YES")
SET(FFMPEG_INCLUDE_DIRS
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavutil
)
# Using the new include style for FFmpeg prevents issues with #include <time.h>
IF (FFMPEG_STDINT_INCLUDE_DIR)
SET(FFMPEG_INCLUDE_DIRS
${FFMPEG_INCLUDE_DIRS}
${FFMPEG_STDINT_INCLUDE_DIR}
${FFMPEG_STDINT_INCLUDE_DIR}/libavformat
${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice
${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec
${FFMPEG_STDINT_INCLUDE_DIR}/libavutil
)
ENDIF()

View File

@@ -9,15 +9,6 @@
#
# Created by Robert Osfield.
# prefer FindFLTK from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindFLTK.cmake)
include(${CMAKE_ROOT}/Modules/FindFLTK.cmake)
if(FLTK_FOUND)
return()
endif()
endif()
FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h
$ENV{FLTK_DIR}/include
$ENV{FLTK_DIR}

View File

@@ -1,98 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[[=======================================================================.rst:
# FindFontconfig
# --------------
#
# Find Fontconfig headers and library.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# ``Fontconfig::Fontconfig``
# The Fontconfig library, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This will define the following variables in your project:
#
# ``FONTCONFIG_FOUND``
# true if (the requested version of) Fontconfig is available.
# ``FONTCONFIG_VERSION``
# the version of Fontconfig.
# ``FONTCONFIG_LIBRARIES``
# the libraries to link against to use Fontconfig.
# ``FONTCONFIG_INCLUDE_DIRS``
# where to find the Fontconfig headers.
# ``FONTCONFIG_COMPILE_OPTIONS``
# this should be passed to target_compile_options(), if the
# target is not used for linking
#=======================================================================]]
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig)
set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER})
set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION})
find_path( FONTCONFIG_INCLUDE_DIR
NAMES
fontconfig/fontconfig.h
HINTS
${PKG_FONTCONFIG_INCLUDE_DIRS}
/usr/X11/include
)
find_library( FONTCONFIG_LIBRARY
NAMES
fontconfig
PATHS
${PKG_FONTCONFIG_LIBRARY_DIRS}
)
if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION)
file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$")
unset(FONTCONFIG_VERSION)
foreach(VPART MAJOR MINOR REVISION)
foreach(VLINE ${_contents})
if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$")
set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}")
if(FONTCONFIG_VERSION)
string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}")
else()
set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}")
endif()
endif()
endforeach()
endforeach()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Fontconfig
FOUND_VAR
FONTCONFIG_FOUND
REQUIRED_VARS
FONTCONFIG_LIBRARY
FONTCONFIG_INCLUDE_DIR
VERSION_VAR
FONTCONFIG_VERSION
)
if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig)
add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED)
set_target_properties(Fontconfig::Fontconfig PROPERTIES
IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}"
)
endif()
mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)
if(FONTCONFIG_FOUND)
set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY})
set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
endif()

View File

@@ -0,0 +1,117 @@
# - Locate FreeType library
# This module defines
# FREETYPE_LIBRARY, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
# $FREETYPE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$FREETYPE_DIR
# used in building FREETYPE.
# Created by Eric Wing.
# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
# put ft2build.h in a common/easier-to-find location which
# then contains a #include to a more specific header in a
# more specific location (#include <freetype/config/ftheader.h>).
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS
$ENV{FREETYPE_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS
/usr/local
/usr
/usr/local/X11R6
/usr/local/X11
/usr/X11R6
/usr/X11
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
$ENV{FREETYPE_DIR}/include/freetype2
NO_DEFAULT_PATH
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include/freetype2
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
/usr/local/include/freetype2
/usr/include/freetype2
/usr/local/X11R6/include/freetype2
/usr/local/X11/include/freetype2
/usr/X11R6/include/freetype2
/usr/X11/include/freetype2
/sw/include/freetype2
/opt/local/include/freetype2
/opt/csw/include/freetype2
/opt/include/freetype2
/usr/freeware/include/freetype2
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS
$ENV{FREETYPE_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS
/usr/local
/usr
/usr/local/X11R6
/usr/local/X11
/usr/X11R6
/usr/X11
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_FOUND "NO")
IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
SET(FREETYPE_FOUND "YES")
ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)

View File

@@ -1,188 +0,0 @@
#.rst:
# FindFreetype
# ------------
#
# Locate FreeType library
#
# This module defines
#
# ::
#
# FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
#
#
# $FREETYPE_DIR is an environment variable that would correspond to the
# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
#=============================================================================
# Copyright 2000-2016 Kitware, Inc.
# Copyright 2000-2011 Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Created by Eric Wing.
# Modifications by Alexander Neundorf.
# This file has been renamed to "FindFreetype.cmake" instead of the correct
# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
# put ft2build.h in a common/easier-to-find location which
# then contains a #include to a more specific header in a
# more specific location (#include <freetype/config/ftheader.h>).
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like include_directories()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
# Adapted for OpenSceneGraph until the updates here for finding the debug Windows library freetyped are released with CMake
set(FREETYPE_FIND_ARGS
HINTS
ENV FREETYPE_DIR
PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
)
find_path(
FREETYPE_INCLUDE_DIR_ft2build
ft2build.h
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
include/freetype2
include
freetype2
)
find_path(
FREETYPE_INCLUDE_DIR_freetype2
NAMES
freetype/config/ftheader.h
config/ftheader.h
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
include/freetype2
include
freetype2
)
if(NOT FREETYPE_LIBRARY)
find_library(FREETYPE_LIBRARY_RELEASE
NAMES
freetype
libfreetype
freetype219
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
lib
)
find_library(FREETYPE_LIBRARY_DEBUG
NAMES
freetyped
libfreetyped
freetype219d
${FREETYPE_FIND_ARGS}
PATH_SUFFIXES
lib
)
include(SelectLibraryConfigurations) #OSG Look in CMake Modules dir
select_library_configurations(FREETYPE)
endif()
unset(FREETYPE_FIND_ARGS)
# set the user variables
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
endif()
if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
file(STRINGS "${FREETYPE_H}" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
unset(FREETYPE_VERSION_STRING)
foreach(VPART MAJOR MINOR PATCH)
foreach(VLINE ${freetype_version_str})
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
if(FREETYPE_VERSION_STRING)
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
else()
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
endif()
unset(FREETYPE_VERSION_PART)
endif()
endforeach()
endforeach()
endif()
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs) #OSG Look in CMake Modules dir
find_package_handle_standard_args(
Freetype
REQUIRED_VARS
FREETYPE_LIBRARY
FREETYPE_INCLUDE_DIRS
VERSION_VAR
FREETYPE_VERSION_STRING
)
mark_as_advanced(
FREETYPE_INCLUDE_DIR_freetype2
FREETYPE_INCLUDE_DIR_ft2build
)

View File

@@ -19,15 +19,6 @@
# This makes the presumption that you are include gdal.h like
# #include "gdal.h"
# prefer FindGDAL from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindGDAL.cmake)
include(${CMAKE_ROOT}/Modules/FindGDAL.cmake)
if(GDAL_FOUND)
return()
endif()
endif()
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
PATHS
$ENV{GDAL_DIR}

View File

@@ -1,36 +0,0 @@
# Finds the OpenGL Core Profile (cp) header file.
# Looks for glcorearb.h
#
# This script defines the following:
# GLCORE_FOUND // Set to TRUE if glcorearb.h is found
# GLCORE_INCLUDE_DIR // Parent directory of directory (gl, GL3, or OpenGL) containing the CP header.
# GLCORE_GLCOREARB_HEADER // advanced
#
# GLCORE_ROOT can be set as an environment variable or a CMake variable,
# to the parent directory of the gl, GL3, or OpenGL directory containing the CP header.
#
FIND_PATH( GLCORE_GLCOREARB_HEADER
NAMES GL/glcorearb.h GL3/glcorearb.h OpenGL/glcorearb.h gl/glcorearb.h
HINTS ${GLCORE_ROOT}
PATHS ENV GLCORE_ROOT
)
set( GLCORE_INCLUDE_DIR )
if( GLCORE_GLCOREARB_HEADER )
set( GLCORE_INCLUDE_DIR ${GLCORE_GLCOREARB_HEADER} )
endif()
# handle the QUIETLY and REQUIRED arguments and set
# GLCORE_FOUND to TRUE as appropriate
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLCORE
"Set GLCORE_ROOT as the parent of the directory containing the OpenGL core profile header."
GLCORE_INCLUDE_DIR )
MARK_AS_ADVANCED(
GLCORE_INCLUDE_DIR
GLCORE_GLCOREARB_HEADER
)

View File

@@ -1,142 +0,0 @@
# - Try to find Glib and its components (gio, gobject etc)
# Once done, this will define
#
# GLIB_FOUND - system has Glib
# GLIB_INCLUDE_DIRS - the Glib include directories
# GLIB_LIBRARIES - link these to use Glib
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and Glib components can be looked for. Currently, the following
# components can be used, and they define the following variables if
# found:
#
# gio: GLIB_GIO_LIBRARIES
# gobject: GLIB_GOBJECT_LIBRARIES
# gmodule: GLIB_GMODULE_LIBRARIES
# gthread: GLIB_GTHREAD_LIBRARIES
#
# Note that the respective _INCLUDE_DIR variables are not set, since
# all headers are in the same directory as GLIB_INCLUDE_DIRS.
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (WIN32)
find_library(GLIB_LIBRARIES
NAMES glib-2.0
PATHS C:/gstreamer/1.0/x86_64/lib
)
else ()
find_package(PkgConfig)
pkg_check_modules(PC_GLIB QUIET glib-2.0)
find_library(GLIB_LIBRARIES
NAMES glib-2.0
HINTS ${PC_GLIB_LIBDIR}
${PC_GLIB_LIBRARY_DIRS}
)
endif ()
# Files in glib's main include path may include glibconfig.h, which,
# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
find_path(GLIBCONFIG_INCLUDE_DIR
NAMES glibconfig.h
HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
PATH_SUFFIXES glib-2.0/include
)
if (WIN32)
find_path(GLIB_INCLUDE_DIR
NAMES glib.h
PATHS C:/gstreamer/1.0/x86_64/include
PATH_SUFFIXES glib-2.0
)
else()
find_path(GLIB_INCLUDE_DIR
NAMES glib.h
HINTS ${PC_GLIB_INCLUDEDIR}
${PC_GLIB_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0
)
endif()
if (GLIBCONFIG_INCLUDE_DIR)
set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
# Version detection
file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
# Additional Glib components. We only look for libraries, as not all of them
# have corresponding headers and all headers are installed alongside the main
# glib ones.
foreach (_component ${GLIB_FIND_COMPONENTS})
if (${_component} STREQUAL "gio")
find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
elseif (${_component} STREQUAL "gobject")
find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
elseif (${_component} STREQUAL "gmodule")
find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
elseif (${_component} STREQUAL "gthread")
find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
elseif (${_component} STREQUAL "gio-unix")
# gio-unix is compiled as part of the gio library, but the include paths
# are separate from the shared glib ones. Since this is currently only used
# by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
endif ()
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
VERSION_VAR GLIB_VERSION)
mark_as_advanced(
GLIBCONFIG_INCLUDE_DIR
GLIB_GIO_LIBRARIES
GLIB_GIO_UNIX_LIBRARIES
GLIB_GMODULE_LIBRARIES
GLIB_GOBJECT_LIBRARIES
GLIB_GTHREAD_LIBRARIES
GLIB_INCLUDE_DIR
GLIB_INCLUDE_DIRS
GLIB_LIBRARIES
)
else()
endif ()

View File

@@ -1,174 +0,0 @@
# - Try to find GStreamer and its plugins
# Once done, this will define
#
# GSTREAMER_FOUND - system has GStreamer
# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
# GSTREAMER_LIBRARIES - link these to use GStreamer
#
# Additionally, gstreamer-base is always looked for and required, and
# the following related variables are defined:
#
# GSTREAMER_BASE_INCLUDE_DIRS - gstreamer-base's include directory
# GSTREAMER_BASE_LIBRARIES - link to these to use gstreamer-base
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and GStreamer plugins can be looked for. Currently, the following
# plugins can be searched, and they define the following variables if
# found:
#
# gstreamer-app: GSTREAMER_APP_INCLUDE_DIRS and GSTREAMER_APP_LIBRARIES
# gstreamer-audio: GSTREAMER_AUDIO_INCLUDE_DIRS and GSTREAMER_AUDIO_LIBRARIES
# gstreamer-fft: GSTREAMER_FFT_INCLUDE_DIRS and GSTREAMER_FFT_LIBRARIES
# gstreamer-pbutils: GSTREAMER_PBUTILS_INCLUDE_DIRS and GSTREAMER_PBUTILS_LIBRARIES
# gstreamer-video: GSTREAMER_VIDEO_INCLUDE_DIRS and GSTREAMER_VIDEO_LIBRARIES
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Helper macro to find a GStreamer plugin (or GStreamer itself)
# _component_prefix is prepended to the _INCLUDE_DIRS and _LIBRARIES variables (eg. "GSTREAMER_AUDIO")
# _pkgconfig_name is the component's pkg-config name (eg. "gstreamer-1.0", or "gstreamer-video-1.0").
# _header is the component's header, relative to the gstreamer-1.0 directory (eg. "gst/gst.h").
# _library is the component's library name (eg. "gstreamer-1.0" or "gstvideo-1.0")
#macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
# pkg_check_modules(PC_${_component_prefix} QUIET ${_pkgconfig_name})
#
# find_path(${_component_prefix}_INCLUDE_DIRS
# NAMES ${_header}
# HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
# PATH_SUFFIXES gstreamer-1.0
# )
#
# find_library(${_component_prefix}_LIBRARIES
# NAMES ${_library}
# HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
# )
#endmacro()
if (MSVC)
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
find_path(${_component_prefix}_INCLUDE_DIRS
NAMES ${_header}
PATHS C:/gstreamer/1.0/x86_64/include
PATH_SUFFIXES gstreamer-1.0
)
find_library(${_component_prefix}_LIBRARIES
NAMES ${_library}
PATHS C:/gstreamer/1.0/x86_64/lib
)
endmacro()
else ()
find_package(PkgConfig)
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
pkg_check_modules(${_component_prefix} QUIET ${_pkgconfig_name})
# find_path(${_component_prefix}_INCLUDE_DIRS
# NAMES ${_header}
# HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
# PATH_SUFFIXES gstreamer-1.0
# )
# find_library(${_component_prefix}_LIBRARIES
# NAMES ${_library}
# HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
# )
endmacro()
endif ()
# ------------------------
# 1. Find GStreamer itself
# ------------------------
# 1.1. Find headers and libraries
FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer-1.0 gst/gst.h gstreamer-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base-1.0 gst/gst.h gstbase-1.0)
# 1.2. Check GStreamer version
if (GSTREAMER_INCLUDE_DIRS)
if (EXISTS "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h")
file(READ "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h" GSTREAMER_VERSION_CONTENTS)
string(REGEX MATCH "#define +GST_VERSION_MAJOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define +GST_VERSION_MINOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define +GST_VERSION_MICRO +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
set(GSTREAMER_VERSION_MICRO "${CMAKE_MATCH_1}")
set(GSTREAMER_VERSION "${GSTREAMER_VERSION_MAJOR}.${GSTREAMER_VERSION_MINOR}.${GSTREAMER_VERSION_MICRO}")
endif ()
endif ()
if ("${GStreamer_FIND_VERSION}" VERSION_GREATER "${GSTREAMER_VERSION}")
message(FATAL_ERROR "Required version (" ${GStreamer_FIND_VERSION} ") is higher than found version (" ${GSTREAMER_VERSION} ")")
endif ()
# -------------------------
# 2. Find GStreamer plugins
# -------------------------
FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app-1.0 gst/app/gstappsink.h gstapp-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio-1.0 gst/audio/audio.h gstaudio-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft-1.0 gst/fft/gstfft.h gstfft-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils-1.0 gst/pbutils/pbutils.h gstpbutils-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-1.0 gst/video/video.h gstvideo-1.0)
# ------------------------------------------------
# 3. Process the COMPONENTS passed to FIND_PACKAGE
# ------------------------------------------------
set(_GSTREAMER_REQUIRED_VARS GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_VERSION GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES)
foreach (_component ${GStreamer_FIND_COMPONENTS})
set(_gst_component "GSTREAMER_${_component}")
string(TOUPPER ${_gst_component} _UPPER_NAME)
list(APPEND _GSTREAMER_REQUIRED_VARS ${_UPPER_NAME}_INCLUDE_DIRS ${_UPPER_NAME}_LIBRARIES)
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer REQUIRED_VARS ${_GSTREAMER_REQUIRED_VARS}
VERSION_VAR GSTREAMER_VERSION)
mark_as_advanced(
GSTREAMER_APP_INCLUDE_DIRS
GSTREAMER_APP_LIBRARIES
GSTREAMER_AUDIO_INCLUDE_DIRS
GSTREAMER_AUDIO_LIBRARIES
GSTREAMER_BASE_INCLUDE_DIRS
GSTREAMER_BASE_LIBRARIES
GSTREAMER_FFT_INCLUDE_DIRS
GSTREAMER_FFT_LIBRARIES
GSTREAMER_INCLUDE_DIRS
GSTREAMER_LIBRARIES
GSTREAMER_PBUTILS_INCLUDE_DIRS
GSTREAMER_PBUTILS_LIBRARIES
GSTREAMER_VIDEO_INCLUDE_DIRS
GSTREAMER_VIDEO_LIBRARIES
)

View File

@@ -1,57 +0,0 @@
# Locate libgta
# This module defines
# GTA_FOUND, if false, do not try to link to libgta
# GTA_INCLUDE_DIRS, where to find the headers
# GTA_LIBRARIES
#
# $GTA_DIR is an environment variable that would
# correspond to the ./configure --prefix=$GTA_DIR
# used in building libgta.
INCLUDE(FindPkgConfig OPTIONAL)
IF(PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(GTA gta)
ENDIF(PKG_CONFIG_FOUND)
IF(NOT GTA_FOUND)
FIND_PATH(GTA_INCLUDE_DIRS gta/gta.hpp
$ENV{GTA_DIR}/include
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(GTA_LIBRARY
NAMES gta libgta
PATHS
$ENV{GTA_DIR}/lib
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(GTA_FOUND "NO")
IF(GTA_LIBRARY AND GTA_INCLUDE_DIRS)
SET(GTA_FOUND "YES")
ENDIF(GTA_LIBRARY AND GTA_INCLUDE_DIRS)
ENDIF(NOT GTA_FOUND)

View File

@@ -9,15 +9,6 @@
#
# Created by Robert Osfield.
# prefer FindJasper from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindJasper.cmake)
include(${CMAKE_ROOT}/Modules/FindJasper.cmake)
if(JASPER_FOUND)
return()
endif()
endif()
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h
$ENV{JASPER_DIR}/include
$ENV{JASPER_DIR}/src/libjasper/include

View File

@@ -1,108 +0,0 @@
#---
# File: FindLIBLAS.cmake
#
# Find the native LIBLAS includes and library
#
# LIBLAS_INCLUDE_DIRS - where to find liblas's includes.
# LIBLAS_LIBRARIES - List of libraries when using liblas.
# LIBLAS_FOUND - True if liblas found.
#---
# Set the include dir:
find_path(LIBLAS_INCLUDE_DIR liblas/liblas.hpp)
# Macro for setting libraries:
macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library(
"${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
${LIBLAS_DIR}/lib/Debug
${LIBLAS_DIR}/lib64/Debug
${LIBLAS_DIR}/lib
${LIBLAS_DIR}/lib64
$ENV{LIBLAS_DIR}/lib/debug
$ENV{LIBLAS_DIR}/lib64/debug
NO_DEFAULT_PATH
)
find_library(
"${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
/usr/freeware/lib64
)
find_library(
${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
${LIBLAS_DIR}/lib/Release
${LIBLAS_DIR}/lib64/Release
${LIBLAS_DIR}/lib
${LIBLAS_DIR}/lib64
$ENV{LIBLAS_DIR}/lib/Release
$ENV{LIBLAS_DIR}/lib64/Release
$ENV{LIBLAS_DIR}/lib
$ENV{LIBLAS_DIR}/lib64
$ENV{LIBLAS_DIR}
$ENV{LIBLASDIR}/lib
$ENV{LIBLASDIR}/lib64
$ENV{LIBLASDIR}
$ENV{LIBLAS_ROOT}/lib
$ENV{LIBLAS_ROOT}/lib64
NO_DEFAULT_PATH
)
find_library(
${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
/usr/freeware/lib64
)
if( NOT ${MYLIBRARY}_DEBUG )
if( MYLIBRARY )
set( ${MYLIBRARY}_DEBUG ${MYLIBRARY} )
endif(MYLIBRARY)
endif( NOT ${MYLIBRARY}_DEBUG )
endmacro(FIND_LIBLAS_LIBRARY LIBRARY LIBRARYNAME)
FIND_LIBLAS_LIBRARY(LIBLAS_LIBRARY las)
set(LIBLAS_FOUND "NO")
if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
FIND_PACKAGE(Boost) # used by LIBLAS
if(Boost_FOUND)
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
set(LIBLAS_FOUND "YES")
if(WIN32)
link_directories(${Boost_LIBRARY_DIRS})
endif()
endif()
endif()

View File

@@ -1,83 +0,0 @@
# Locate Lua library
# This module defines
# LUA51_FOUND, if false, do not try to link to Lua
# LUA_LIBRARIES
# LUA_INCLUDE_DIR, where to find lua.h
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
#
# Note that the expected include convention is
# #include "lua.h"
# and not
# #include <lua/lua.h>
# This is because, the lua location is not standardized and may exist
# in locations other than lua/
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua include
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
find_library(LUA_LIBRARY
NAMES lua52 lua5.2 lua-5.2 lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
if(LUA_LIBRARY)
# include the math library for Unix
if(UNIX AND NOT APPLE)
find_library(LUA_MATH_LIBRARY m)
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
else()
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
endif()
endif()
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
unset(lua_version_str)
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)

View File

@@ -15,8 +15,7 @@ FIND_PATH(NVTT_INCLUDE_DIR nvtt/nvtt.h
PATH_SUFFIXES include
)
# NVTT
FIND_LIBRARY(NVTT_LIBRARY_RELEASE
FIND_LIBRARY(NVTT_LIBRARY
NAMES nvtt
PATHS
/usr/local
@@ -26,18 +25,7 @@ FIND_LIBRARY(NVTT_LIBRARY_RELEASE
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVTT_LIBRARY_DEBUG
NAMES nvtt_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVIMAGE
FIND_LIBRARY(NVIMAGE_LIBRARY_RELEASE
FIND_LIBRARY(NVIMAGE_LIBRARY
NAMES nvimage
PATHS
/usr/local
@@ -47,18 +35,7 @@ FIND_LIBRARY(NVIMAGE_LIBRARY_RELEASE
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVIMAGE_LIBRARY_DEBUG
NAMES nvimage_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVMATH
FIND_LIBRARY(NVMATH_LIBRARY_RELEASE
FIND_LIBRARY(NVMATH_LIBRARY
NAMES nvmath
PATHS
/usr/local
@@ -68,18 +45,7 @@ FIND_LIBRARY(NVMATH_LIBRARY_RELEASE
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVMATH_LIBRARY_DEBUG
NAMES nvmath_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVCORE
FIND_LIBRARY(NVCORE_LIBRARY_RELEASE
FIND_LIBRARY(NVCORE_LIBRARY
NAMES nvcore
PATHS
/usr/local
@@ -88,124 +54,8 @@ FIND_LIBRARY(NVCORE_LIBRARY_RELEASE
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVCORE_LIBRARY_DEBUG
NAMES nvcore_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVTHREAD
FIND_LIBRARY(NVTHREAD_LIBRARY_RELEASE
NAMES nvthread
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVTHREAD_LIBRARY_DEBUG
NAMES nvthread_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# SQUISH
FIND_LIBRARY(NVSQUISH_LIBRARY_RELEASE
NAMES squish
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVSQUISH_LIBRARY_DEBUG
NAMES squish_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# BC6H
FIND_LIBRARY(NVBC6H_LIBRARY_RELEASE
NAMES bc6h
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVBC6H_LIBRARY_DEBUG
NAMES bc6h_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# BC7
FIND_LIBRARY(NVBC7_LIBRARY_RELEASE
NAMES bc7
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVBC7_LIBRARY_DEBUG
NAMES bc7_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
IF (WIN32)
SET(LIBS_TO_SETUP "NVTT" "NVCORE" "NVMATH" "NVIMAGE" "NVTHREAD" "NVBC7" "NVBC6H" "NVSQUISH")
ELSE()
SET(LIBS_TO_SETUP "NVTT" "NVCORE" "NVMATH" "NVIMAGE")
ENDIF()
FOREACH(LIB ${LIBS_TO_SETUP})
IF(${LIB}_LIBRARY_DEBUG)
SET(${LIB}_LIBRARIES optimized ${${LIB}_LIBRARY_RELEASE} debug ${${LIB}_LIBRARY_DEBUG})
ELSE(${LIB}_LIBRARY_DEBUG)
SET(${LIB}_LIBRARY_DEBUG ${${LIB}_LIBRARY_RELEASE})
SET(${LIB}_LIBRARIES optimized ${${LIB}_LIBRARY_RELEASE} debug ${${LIB}_LIBRARY_DEBUG})
ENDIF(${LIB}_LIBRARY_DEBUG)
ENDFOREACH(LIB ${LIBS_TO_SETUP})
SET(NVTT_LIBRARIES
${NVTT_LIBRARIES}
${NVCORE_LIBRARIES}
${NVMATH_LIBRARIES}
${NVIMAGE_LIBRARIES}
${NVTHREAD_LIBRARIES}
${NVBC7_LIBRARIES}
${NVBC6H_LIBRARIES}
${NVSQUISH_LIBRARIES}
)
SET(NVTT_FOUND "NO")
IF(NVTT_LIBRARY_RELEASE AND NVTT_INCLUDE_DIR)
SET(NVTT_FOUND "YES" )
ENDIF(NVTT_LIBRARY_RELEASE AND NVTT_INCLUDE_DIR)
IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)
SET(NVTT_FOUND "YES")
ENDIF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)

View File

@@ -1,13 +1,13 @@
# Locate gdal
# This module defines
# OSG_LIBRARY
# OSG_FOUND, if false, do not try to link to gdal
# OSG_FOUND, if false, do not try to link to gdal
# OSG_INCLUDE_DIR, where to find the headers
#
# $OSG_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OSG_DIR
#
# Created by Robert Osfield.
# Created by Robert Osfield.
FIND_PATH(OSG_INCLUDE_DIR osg/Node
${OSG_DIR}/include
@@ -59,7 +59,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
@@ -96,18 +96,13 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
IF( NOT ${MYLIBRARY}_DEBUG)
IF(MYLIBRARY)
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
ENDIF(MYLIBRARY)
ELSE()
IF( NOT MYLIBRARY )
SET(${MYLIBRARY} ${${MYLIBRARY}_DEBUG} )
ENDIF(NOT MYLIBRARY)
ENDIF( NOT ${MYLIBRARY}_DEBUG )
ENDIF(MYLIBRARY)
ENDIF( NOT ${MYLIBRARY}_DEBUG)
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
@@ -120,15 +115,8 @@ FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
FIND_OSG_LIBRARY(OSGMANIPULATOR_LIBRARY osgManipulator)
FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim)
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
SET(OSG_FOUND "NO")
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
SET(OSG_FOUND "YES")

View File

@@ -1,174 +0,0 @@
# LocateOPENCASCADE
# This module defines
# OPENCASCADE_LIBRARY
# OPENCASCADE_FOUND, if false, do not try to link to OPENCASCADE
# OPENCASCADE_INCLUDE_DIR, where to find the headers
#
# $OPENCASCADE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
# used in building OPENCASCADE.
FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
PATHS
${OPENCASCADE_DIR}
$ENV{OPENCASCADE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
/usr/freeware
PATH_SUFFIXES
opencascade
inc
include
inc/cascade
include/cascade
)
MACRO(FIND_OPENCASCADE_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY("${MYLIBRARY}"
NAMES "${MYLIBRARYNAME}"
PATHS
$ENV{OPENCASCADE_DIR}/lib}
$ENV{OPENCASCADE_LIB}
${OPENCASCADE_DIR}/lib
$ENV{OPENCASCADE_DIR}/lib
${OPENCASCADE_DIR}/lib/
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO()
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinL TKBinL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBin TKBin)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinTObj TKBinTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinXCAF TKBinXCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBool TKBool)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBO TKBO)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBRep TKBRep)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKCAF TKCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKCDF TKCDF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKernel TKernel)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKFeat TKFeat)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKFillet TKFillet)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKG2d TKG2d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKG3d TKG3d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKGeomAlgo TKGeomAlgo)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKGeomBase TKGeomBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKHLR TKHLR)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKIGES TKIGES)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKLCAF TKLCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMath TKMath)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMesh TKMesh)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMeshVS TKMeshVS)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKOffset TKOffset)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKOpenGl TKOpenGl)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKPrim TKPrim)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKService TKService)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKShHealing TKShHealing)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEP209 TKSTEP209)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEPAttr TKSTEPAttr)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEPBase TKSTEPBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEP TKSTEP)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTL TKSTL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTObj TKTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTopAlgo TKTopAlgo)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKV3d TKV3d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKVRML TKVRML)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDEIGES TKXDEIGES)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDESTEP TKXDESTEP)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXMesh TKXMesh)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlL TKXmlL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXml TKXml)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlTObj TKXmlTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF)
set (OPENCASCADE_LIBRARY_TYPE_DESCR
"Specifies the type of library to be used. 'Shared' libraries
are linked dynamically and loaded at runtime. 'Static' libraries
are archives of object files for use when linking other targets")
# set type of OCCT libraries
if (NOT OPENCASCADE_LIBRARY_TYPE)
set (OPENCASCADE_LIBRARY_TYPE "Static" CACHE STRING "${OPENCASCADE_LIBRARY_TYPE_DESCR}" FORCE)
SET_PROPERTY(CACHE OPENCASCADE_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
endif()
if ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_LIBRARY ${OPENCASCADE_LIBRARY}
${OPENCASCADE_TKernel}
${OPENCASCADE_TKMath}
${OPENCASCADE_TKXCAF}
${OPENCASCADE_TKXSBase}
${OPENCASCADE_TKSTEPAttr}
${OPENCASCADE_TKSTEPBase}
${OPENCASCADE_TKSTEP209}
${OPENCASCADE_TKSTEP}
${OPENCASCADE_TKXDESTEP}
${OPENCASCADE_TKIGES}
${OPENCASCADE_TKXDEIGES}
${OPENCASCADE_TKLCAF}
${OPENCASCADE_TKBRep}
${OPENCASCADE_TKMesh}
${OPENCASCADE_TKTopAlgo}
${OPENCASCADE_TKShHealing}
)
else ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_LIBRARY ${OPENCASCADE_LIBRARY}
${OPENCASCADE_TKBO}
${OPENCASCADE_TKBool}
${OPENCASCADE_TKBRep}
${OPENCASCADE_TKCAF}
${OPENCASCADE_TKCDF}
${OPENCASCADE_TKernel}
${OPENCASCADE_TKG2d}
${OPENCASCADE_TKG3d}
${OPENCASCADE_TKGeomAlgo}
${OPENCASCADE_TKGeomBase}
${OPENCASCADE_TKHLR}
${OPENCASCADE_TKIGES}
${OPENCASCADE_TKLCAF}
${OPENCASCADE_TKMath}
${OPENCASCADE_TKMesh}
${OPENCASCADE_TKPrim}
${OPENCASCADE_TKService}
${OPENCASCADE_TKShHealing}
${OPENCASCADE_TKSTEP}
${OPENCASCADE_TKSTEP209}
${OPENCASCADE_TKSTEPAttr}
${OPENCASCADE_TKSTEPBase}
${OPENCASCADE_TKTopAlgo}
${OPENCASCADE_TKV3d}
${OPENCASCADE_TKXCAF}
${OPENCASCADE_TKXDEIGES}
${OPENCASCADE_TKXDESTEP}
${OPENCASCADE_TKXSBase}
)
endif ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_FOUND "NO")
IF(OPENCASCADE_LIBRARY AND OPENCASCADE_INCLUDE_DIR)
SET(OPENCASCADE_FOUND "YES")
ENDIF(OPENCASCADE_LIBRARY AND OPENCASCADE_INCLUDE_DIR)
IF(OPENCASCADE_INCLUDE_DIR)
SET(OPENCASCADE_FOUND "YES")
ENDIF(OPENCASCADE_INCLUDE_DIR)

View File

@@ -9,7 +9,6 @@
#
# Created by Robert Osfield.
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
$ENV{OPENEXR_DIR}/include
$ENV{OPENEXR_DIR}
@@ -24,38 +23,78 @@ FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
/usr/freeware/include
)
# Macro to find exr libraries (deduplicating search paths)
# example: OPENEXR_FIND_VAR(OPENEXR_IlmImf_LIBRARY IlmImf)
MACRO(OPENEXR_FIND_VAR varname libname)
FIND_LIBRARY( ${varname}
NAMES ${libname} ${libname}-2_1 ${libname}-2_2
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO(OPENEXR_FIND_VAR)
FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
NAMES IlmImf
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
# Macro to find exr libraries (and debug versions)
# example: OPENEXR_FIND(IlmImf)
MACRO(OPENEXR_FIND libname)
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY ${libname})
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY_DEBUG ${libname}d)
ENDMACRO(OPENEXR_FIND)
FIND_LIBRARY(OPENEXR_IlmThread_LIBRARY
NAMES IlmThread
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
OPENEXR_FIND(IlmImf)
FIND_LIBRARY(OPENEXR_Iex_LIBRARY
NAMES Iex
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
FIND_LIBRARY(OPENEXR_Half_LIBRARY
NAMES Half
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(OPENEXR_FOUND "NO")
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY)
SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} )
SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY )
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
SET(OPENEXR_LIBRARIES
${OPENEXR_IlmIlf_LIBRARY}
${OPENEXR_IlmThread_LIBRARY}
${OPENEXR_Half_LIBRARY}
${OPENEXR_Iex_LIBRARY}
)
SET(OPENEXR_FOUND "YES")
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY)
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)

View File

@@ -17,16 +17,6 @@
#
# Created by Eric Wing.
# prefer FindOpenThreads from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindOpenThreads.cmake)
include(${CMAKE_ROOT}/Modules/FindOpenThreads.cmake)
if(OPENTHREADS_FOUND)
return()
endif()
endif()
# Header files are presumed to be included like
# #include <OpenThreads/Thread>

View File

@@ -0,0 +1,270 @@
# - find DCMTK libraries
#
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# DCMTK_LIBRARIES - Files to link against to use DCMTK
# DCMTK_FOUND - If false, don't try to use DCMTK
# DCMTK_DIR - (optional) Source directory for DCMTK
#
# DCMTK_DIR can be used to make it simpler to find the various include
# directories and compiled libraries if you've just compiled it in the
# source tree. Just set it to the root of the tree where you extracted
# the source.
#
# Written for VXL by Amitha Perera.
# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/dicom/include
/usr/local/include/
/usr/include/
/usr/local/dicom/include/
)
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/dicom/include
/usr/local/include/dcmtk/config
/usr/include/dcmtk/config
/usr/local/dicom/include/dcmtk/config
)
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
${DCMTK_DIR}/ofstd/include
${DCMTK_DIR}/include/ofstd
/usr/local/dicom/include/dcmtk/ofstd
/usr/local/include/dcmtk/ofstd
/usr/include/dcmtk/ofstd
/usr/local/dicom/include/dcmtk/ofstd
)
FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
PATHS
${DCMTK_DIR}/ofstd/libsrc
${DCMTK_DIR}/ofstd/libsrc/Release
${DCMTK_DIR}/ofstd/libsrc/Debug
${DCMTK_DIR}/ofstd/Release
${DCMTK_DIR}/ofstd/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
${DCMTK_DIR}/dcmdata/include
${DCMTK_DIR}/include/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
/usr/local/include/dcmtk/dcmdata
/usr/include/dcmtk/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
)
FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
PATHS
${DCMTK_DIR}/dcmdata/libsrc
${DCMTK_DIR}/dcmdata/libsrc/Release
${DCMTK_DIR}/dcmdata/libsrc/Debug
${DCMTK_DIR}/dcmdata/Release
${DCMTK_DIR}/dcmdata/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
${DCMTK_DIR}/dcmimgle/include
${DCMTK_DIR}/include/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
/usr/local/include/dcmtk/dcmimgle
/usr/include/dcmtk/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
)
FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
PATHS
${DCMTK_DIR}/dcmimgle/libsrc
${DCMTK_DIR}/dcmimgle/libsrc/Release
${DCMTK_DIR}/dcmimgle/libsrc/Debug
${DCMTK_DIR}/dcmimgle/Release
${DCMTK_DIR}/dcmimgle/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmimage_INCLUDE_DIR diregist.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimage
${DCMTK_DIR}/dcmimage/include
${DCMTK_DIR}/include/dcmimage
/usr/local/dicom/include/dcmtk/dcmimage
/usr/local/include/dcmtk/dcmimage
/usr/include/dcmtk/dcmimage
/usr/local/dicom/include/dcmtk/dcmimage
)
FIND_LIBRARY( DCMTK_dcmimage_LIBRARY dcmimage
PATHS
${DCMTK_DIR}/dcmimage/libsrc
${DCMTK_DIR}/dcmimage/libsrc/Release
${DCMTK_DIR}/dcmimage/libsrc/Debug
${DCMTK_DIR}/dcmimage/Release
${DCMTK_DIR}/dcmimage/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
PATHS
${DCMTK_DIR}/imagectn/libsrc/Release
${DCMTK_DIR}/imagectn/libsrc/
${DCMTK_DIR}/imagectn/libsrc/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_oflog_LIBRARY oflog
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_ofstd_LIBRARY ofstd
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
IF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY
AND DCMTK_dcmimgle_INCLUDE_DIR
AND DCMTK_dcmimgle_LIBRARY
AND DCMTK_dcmimage_INCLUDE_DIR
AND DCMTK_dcmimage_LIBRARY )
SET( DCMTK_FOUND "YES" )
SET( DCMTK_INCLUDE_DIRS
${DCMTK_config_INCLUDE_DIR}
${DCMTK_ofstd_INCLUDE_DIR}
${DCMTK_dcmdata_INCLUDE_DIR}
${DCMTK_dcmimgle_INCLUDE_DIR}
${DCMTK_dcmimage_INCLUDE_DIR}
)
SET( DCMTK_LIBRARIES
${DCMTK_dcmimgle_LIBRARY}
${DCMTK_dcmimage_LIBRARY}
${DCMTK_dcmdata_LIBRARY}
${DCMTK_ofstd_LIBRARY}
${DCMTK_config_LIBRARY}
)
IF(DCMTK_imagedb_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_imagedb_LIBRARY}
)
ENDIF()
IF(DCMTK_dcmnet_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_dcmnet_LIBRARY}
)
ENDIF()
IF(DCMTK_oflog_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_oflog_LIBRARY}
)
ENDIF()
IF(DCMTK_ofstd_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_ofstd_LIBRARY}
)
ENDIF()
IF( WIN32 )
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
ENDIF()
ENDIF()
IF( NOT DCMTK_FOUND )
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
MARK_AS_ADVANCED( DCMTK_DIR )
ENDIF()

View File

@@ -1,23 +0,0 @@
# Locate Apple QuartzCore
# This module defines
# QUARTZCORE_LIBRARY
# QUARTZCORE_FOUND, if false, do not try to link to QUARTZCORE
# QUARTZCORE_INCLUDE_DIR, where to find the headers
#
# $QUARTZCORE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$QUARTZCORE_DIR
#
# Created by Stephan Maximilian Huber.
IF(APPLE)
FIND_PATH(QUARTZCORE_INCLUDE_DIR QuartzCore/QuartzCore.h)
FIND_LIBRARY(QUARTZCORE_LIBRARY QuartzCore)
ENDIF()
SET(QUARTZCORE_FOUND "NO")
IF(QUARTZCORE_LIBRARY AND QUARTZCORE_INCLUDE_DIR)
SET(QUARTZCORE_FOUND "YES")
ENDIF()

View File

@@ -1,14 +1,13 @@
# Locate QuickTime
# This module defines
# QUICKTIME_LIBRARY
# QUICKTIME_FOUND, if false, do not try to link to gdal
# QUICKTIME_FOUND, if false, do not try to link to gdal
# QUICKTIME_INCLUDE_DIR, where to find the headers
#
# $QUICKTIME_DIR is an environment variable that would
# correspond to the ./configure --prefix=$QUICKTIME_DIR
#
# Created by Eric Wing.
# Created by Eric Wing.
# QuickTime on OS X looks different than QuickTime for Windows,
# so I am going to case the two.
@@ -50,25 +49,18 @@ ENDIF()
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
SET(QUICKTIME_FOUND "NO")
ELSE()
IF(APPLE)
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE("Disabling QuickTime on 64-bit architectures")
ENDIF()
IF(APPLE)
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(QUICKTIME_FOUND "NO")
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.6)
# Quicktime officially deprecated starting 10.7
MESSAGE("Disabling QuickTime because it's not supported by the selected SDK ${OSG_OSX_VERSION}")
SET(QUICKTIME_FOUND "NO")
ELSE()
ELSE()
#Otherwise check to see if 64-bit is explicitly called for.
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
IF(NOT has64Compile EQUAL -1)
MESSAGE("Disabling QuickTime on 64-bit architectures")
SET(QUICKTIME_FOUND "NO")
SET(QUICKTIME_FOUND "NO")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
ENDIF()

View File

@@ -5,9 +5,7 @@ IF(PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
#Version 2.35 introduces the rsvg_cleanup function which is used
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
PKG_CHECK_MODULES(RSVG librsvg-2.0)
PKG_CHECK_MODULES(CAIRO cairo)
IF (RSVG_FOUND AND NOT CAIRO_FOUND)

View File

@@ -1,178 +0,0 @@
# - Locate SDL library
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL
# SDL2_INCLUDE_DIR, where to find SDL.h
# SDL2_VERSION_STRING, human-readable string containing the version of SDL
#
# This module responds to the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL library
# (SDL.dll, libsdl.so, SDL.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
# used in building SDL.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDLmain which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_path(SDL2_INCLUDE_DIR SDL.h
HINTS
ENV SDL2DIR
PATH_SUFFIXES include/SDL2
)
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
find_library(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
ENV SDL2DIR
PATH_SUFFIXES lib
)
if(NOT SDL2_BUILDING_LIBRARY)
if(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDLmain for compatibility even though they don't
# necessarily need it.
find_library(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
ENV SDL2DIR
PATH_SUFFIXES lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
endif()
endif()
# SDL may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
if(NOT APPLE)
find_package(Threads)
endif()
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
if(MINGW)
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
endif()
if(SDL2_LIBRARY_TEMP)
# For SDLmain
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY)
list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX)
if(_SDL2_MAIN_INDEX EQUAL -1)
set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP})
endif()
unset(_SDL2_MAIN_INDEX)
endif()
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
if(APPLE)
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
endif()
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
if(NOT APPLE)
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
endif()
# For MinGW library
if(MINGW)
set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
endif()
# Set the final string here so the GUI reflects the final state.
set(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
set(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
endif()
if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL2_version.h")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}")
set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH})
unset(SDL2_VERSION_MAJOR_LINE)
unset(SDL2_VERSION_MINOR_LINE)
unset(SDL2_VERSION_PATCH_LINE)
unset(SDL2_VERSION_MAJOR)
unset(SDL2_VERSION_MINOR)
unset(SDL2_VERSION_PATCH)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
VERSION_VAR SDL2_VERSION_STRING)

View File

@@ -1,45 +0,0 @@
# Locate V8
# This module defines
# V8_LIBRARY
# V8_FOUND, if false, do not try to link to gdal
# V8_INCLUDE_DIR, where to find the headers
#
# $V8_DIR is an environment variable that would
# correspond to the ./configure --prefix=$V8_DIR
#
# Created by Robert Osfield (based on FindFLTK.cmake)
FIND_PATH(V8_INCLUDE_DIR v8.h
$ENV{V8_DIR}/include
$ENV{V8_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(V8_LIBRARY
NAMES v8 libv8
PATHS
$ENV{V8_DIR}/lib
$ENV{V8_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(V8_FOUND "NO")
IF(V8_LIBRARY AND V8_INCLUDE_DIR)
SET(V8_FOUND "YES")
ENDIF()

View File

@@ -0,0 +1,48 @@
# Locate zlib
# This module defines
# ZLIB_LIBRARY
# ZLIB_FOUND, if false, do not try to link to zlib
# ZLIB_INCLUDE_DIR, where to find the headers
#
# $ZLIB_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ZLIB_DIR
# used in building zlib.
#
# Created by Ulrich Hertlein.
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
$ENV{ZLIB_DIR}/include
$ENV{ZLIB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(ZLIB_LIBRARY
NAMES z libz zlib
PATHS
$ENV{ZLIB_DIR}/lib
$ENV{ZLIB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(ZLIB_FOUND "NO")
IF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
SET(ZLIB_FOUND "YES")
ENDIF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)

View File

@@ -1,47 +0,0 @@
# Locate ZeroConf / Bonjour
# This module defines
# ZEROCONF_LIBRARY
# ZEROCONF_FOUND, if false, do not try to link to gdal
# ZEROCONF_INCLUDE_DIR, where to find the headers
#
# $ZEROCONF_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ZEROCONF_DIR
# Created by Stephan Maximilian Huber
SET(ZEROCONF_FOUND "NO")
IF(APPLE)
# bonjour is part of the system on os x / ios
SET(ZEROCONF_FOUND "YES")
ELSE()
IF(WIN32)
# find the Bonjour SDK
FIND_PATH(ZEROCONF_INCLUDE_DIR dnssd.h
$ENV{ZEROCONF_DIR}/include
$ENV{ZEROCONF_DIR}
NO_DEFAULT_PATH
)
FIND_PATH(ZEROCONF_INCLUDE_DIR dnssd.h
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(ZEROCONF_INCLUDE_DIR dnssd.h)
FIND_LIBRARY(ZEROCONF_LIBRARY dnssd
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(ZEROCONF_LIBRARY dnssd)
SET(ZEROCONF_FOUND "NO")
IF(ZEROCONF_LIBRARY AND ZEROCONF_INCLUDE_DIR)
SET(ZEROCONF_FOUND "YES")
ENDIF()
ELSE()
# TODO find AVAHI on linux
ENDIF()
ENDIF()

View File

@@ -1,63 +0,0 @@
# Locate ILMBASE
# This module defines
# ILMBASE_LIBRARY
# ILMBASE_FOUND, if false, do not try to link to ILMBASE
# ILMBASE_INCLUDE_DIR, where to find the headers
#
# $ILMBASE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ILMBASE_DIR
#
# Created by Robert Osfield.
FIND_PATH(ILMBASE_INCLUDE_DIR OpenEXR/ImathVec.h
$ENV{ILMBASE_DIR}/include
$ENV{ILMBASE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
# Macro to find ilmbase libraries
# example: ILMBASE_FIND_VAR(OPENEXR_IlmThread_LIBRARY IlmThread)
MACRO(ILMBASE_FIND_VAR varname libname)
FIND_LIBRARY( ${varname}
NAMES ${libname} ${libname}-2_1 ${libname}-2_2
PATHS
$ENV{ILMBASE_DIR}/lib
$ENV{ILMBASE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO(ILMBASE_FIND_VAR)
# Macro to find exr libraries (and debug versions)
# example: ILMBASE_FIND(OPENEXR_IlmThread_LIBRARY IlmThread)
MACRO(ILMBASE_FIND libname)
ILMBASE_FIND_VAR(ILMBASE_${libname}_LIBRARY ${libname})
ILMBASE_FIND_VAR(ILMBASE_${libname}_LIBRARY_DEBUG ${libname}d)
ENDMACRO(ILMBASE_FIND)
ILMBASE_FIND(IlmThread)
ILMBASE_FIND(Iex)
ILMBASE_FIND(Half)
SET(ILMBASE_FOUND "NO")
IF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)
SET(ILMBASE_LIBRARIES ${ILMBASE_IlmThread_LIBRARY} ${ILMBASE_Half_LIBRARY} ${ILMBASE_Iex_LIBRARY} )
SET(ILMBASE_LIBRARIES_VARS ILMBASE_IlmThread_LIBRARY ILMBASE_Half_LIBRARY ILMBASE_Iex_LIBRARY )
SET(ILMBASE_FOUND "YES")
ENDIF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)

View File

@@ -25,6 +25,14 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
HANDLE_MSVC_DLL()
ENDIF()
IF(ANDROID)
INSTALL (
FILES ${TARGET_H}
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
COMPONENT libopenscenegraph-dev
)
ELSE(ANDROID)
INSTALL(
TARGETS ${LIB_NAME}
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
@@ -32,21 +40,6 @@ INSTALL(
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
)
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
SET(PREFIX "")
ENDIF()
IF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Release)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
ELSE ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
ENDIF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
IF(NOT OSG_COMPILE_FRAMEWORKS)
INSTALL (
FILES ${TARGET_H}
@@ -66,3 +59,4 @@ ELSE()
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
ENDIF()
ENDIF(ANDROID)

View File

@@ -1,15 +1,12 @@
MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
#foreach(arg ${TARGET_LIBRARIES})
# set(MODULE_LIBS "${MODULE_LIBS} -l${arg}")
#endforeach(arg ${TARGET_LIBRARIES})
foreach(arg ${TARGET_LIBRARIES})
set(MODULE_LIBS "${MODULE_LIBS} -l${arg}")
endforeach(arg ${TARGET_LIBRARIES})
foreach(arg ${TARGET_SRC})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" n_f ${arg})
IF ("${arg}" MATCHES ".*\\.c$" OR "${arg}" MATCHES ".*\\.cpp$")
#We only include source files, not header files, this removes anoying warnings
set(MODULE_SOURCES "${MODULE_SOURCES} ${n_f}")
ENDIF()
set(MODULE_SOURCES "${MODULE_SOURCES} ${n_f}")
endforeach(arg ${TARGET_SRC})
#SET(MODULE_INCLUDES "${CMAKE_SOURCE_DIR}/include include")
@@ -38,8 +35,7 @@ MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
ELSEIF(OSG_GLES2_AVAILABLE)
SET(OPENGLES_LIBRARY -lGLESv2)
ENDIF()
#${MODULE_LIBS}
set(MODULE_LIBS_FLAGS "${OPENGLES_LIBRARY} -ldl")
set(MODULE_LIBS "${MODULE_LIBS} ${OPENGLES_LIBRARY} -ldl")
if(NOT CPP_EXTENSION)
set(CPP_EXTENSION "cpp")
endif()
@@ -48,12 +44,8 @@ MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
ENDIF()
IF("MODULE_USER_STATIC_OR_DYNAMIC" MATCHES "STATIC")
SET(MODULE_BUILD_TYPE "\$\(BUILD_STATIC_LIBRARY\)")
SET(MODULE_LIBS_SHARED " ")
SET(MODULE_LIBS_STATIC ${TARGET_LIBRARIES})
ELSE()
SET(MODULE_BUILD_TYPE "\$\(BUILD_SHARED_LIBRARY\)")
SET(MODULE_LIBS_SHARED ${TARGET_LIBRARIES})
SET(MODULE_LIBS_STATIC " ")
SET(MODULE_BUILD_TYPE "\$\(BUILD_DYNAMIC_LIBRARY\)")
ENDIF()
set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} ${LIB_NAME}")
set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CMAKE_CURRENT_BINARY_DIR}/Android.mk \n")
@@ -67,7 +59,7 @@ MACRO(ANDROID_3RD_PARTY)
#JPEG
################################################
FIND_PATH(JPEG_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/libjpeg NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/libjpeg
)
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libjpeg")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${JPEG_INCLUDE_DIR}/Android.mk \n")
@@ -82,7 +74,7 @@ MACRO(ANDROID_3RD_PARTY)
#PNG
################################################
FIND_PATH(PNG_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/libpng NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/libpng
)
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libpng")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${PNG_INCLUDE_DIR}/Android.mk \n")
@@ -97,7 +89,7 @@ MACRO(ANDROID_3RD_PARTY)
#GIF
################################################
FIND_PATH(GIFLIB_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/giflib NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/giflib
)
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libgif")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${GIFLIB_INCLUDE_DIR}/Android.mk \n")
@@ -112,7 +104,7 @@ MACRO(ANDROID_3RD_PARTY)
#TIF
################################################
FIND_PATH(TIFF_INCLUDE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/libtiff NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/libtiff
)
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libtiff")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${TIFF_INCLUDE_DIR}/Android.mk \n")
@@ -142,7 +134,7 @@ MACRO(ANDROID_3RD_PARTY)
#CURL
################################################
FIND_PATH(CURL_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/curl NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/curl
)
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libcurl")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CURL_DIR}/Android.mk \n")
@@ -159,11 +151,11 @@ MACRO(ANDROID_3RD_PARTY)
#FREETYPE
################################################
FIND_PATH(FREETYPE_DIR Android.mk
${CMAKE_SOURCE_DIR}/3rdparty/freetype NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/freetype
)
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libft2")
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${FREETYPE_DIR}/Android.mk \n")
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config")
if(FREETYPE_DIR)
message(STATUS "FREETYPE found ${FREETYPE_DIR}" )
set(FREETYPE_FOUND "Yes")
@@ -175,7 +167,7 @@ MACRO(ANDROID_3RD_PARTY)
#GDAL
################################################
FIND_PATH(GDAL_DIR gdal.h
${CMAKE_SOURCE_DIR}/3rdparty/gdal/include NO_CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/3rdparty/gdal/include
)
set(GDAL_INCLUDE_DIR "${GDAL_DIR}")
if(GDAL_DIR)

View File

@@ -57,7 +57,7 @@ ENDIF()
SET(CPACK_SOURCE_GENERATOR "TGZ")
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
IF(MSVC_IDE)
SET(OSG_CPACK_CONFIGURATION "$(OutDir)")
SET(PACKAGE_TARGET_PREFIX "Package ")
@@ -84,87 +84,9 @@ ENDIF()
SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
# cpack configuration for debian packages
IF(${CPACK_GENERATOR} STREQUAL "DEB")
SET(OPENSCENEGRAPH_PACKAGE_MAINTAINER
""
CACHE STRING
"Name and email address of the package maintainer, e.g., 'Jon Doe <jon.doe@superawesomemail.com>'"
)
SET(CPACK_LIBOPENSCENEGRAPH_DEPENDENCIES
"libopenthreads"
CACHE STRING
"Dependend packages for the openscenegraph library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH-DEV_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the openscenegraph development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS_DEPENDENCIES
""
CACHE STRING
"Dependend packages for the openthreads library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS-DEV_DEPENDENCIES
"libopenthreads"
CACHE STRING
"Dependend packages for the openthreads development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the openscenegraph main package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH-ALL_DEPENDENCIES
""
CACHE STRING
"Dependend packages for the openscenegraph package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH-DEV_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openthreads library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS-DEV_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openthreads development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph main package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH-ALL_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
ENDIF()
MACRO(GENERATE_PACKAGING_TARGET package_name)
SET(CPACK_PACKAGE_NAME ${package_name})
# set debian dependencies AND conflicts
IF(${CPACK_GENERATOR} STREQUAL "DEB")
STRING(TOUPPER CPACK_${package_name}_DEPENDENCIES DEPENDENCIES_VAR)
STRING(TOUPPER CPACK_${package_name}_CONFLICTS CONFLICTS_VAR)
SET(OSG_PACKAGE_DEPENDS "${${DEPENDENCIES_VAR}}")
SET(OSG_PACKAGE_CONFLICTS "${${CONFLICTS_VAR}}")
ENDIF()
# the doc packages don't need a system-arch specification
IF(${package} MATCHES -doc)
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION})
@@ -192,7 +114,7 @@ MACRO(GENERATE_PACKAGING_TARGET package_name)
ELSE()
SET(ARCHIVE_EXT "tar.gz")
ENDIF()
# Create a target that creates the current package
# and rename the package to give it proper filename
ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
@@ -202,8 +124,8 @@ MACRO(GENERATE_PACKAGING_TARGET package_name)
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
COMMENT "Run CPack packaging for ${package_name}..."
)
# Add the exact same custom command to the all package generating target.
# I can't use add_dependencies to do this because it would allow parallel building of packages so am going brute here
# Add the exact same custom command to the all package generating target.
# I can't use add_dependencies to do this because it would allow parallell building of packages so am going brute here
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
)

View File

@@ -53,7 +53,7 @@ SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The OpenSceneGraph is an open source high performance 3d graphics toolkit")
SET(CPACK_PACKAGE_FILE_NAME "${OSG_PACKAGE_FILE_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
@@ -66,16 +66,6 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "${OPENSCENEGRAPH_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
SET(CPACK_STRIP_FILES "ON")
# DEBIAN OPTIONS
IF(${CPACK_GENERATOR} STREQUAL "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${OPENSCENEGRAPH_PACKAGE_MAINTAINER}")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.openscenegraph.org")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Development")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${OSG_PACKAGE_DEPENDS}")
SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "${OSG_PACKAGE_CONFLICTS}")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${OpenSceneGraph_SOURCE_DIR}/debian_scripts/postinst;")
ENDIF()

View File

@@ -1,22 +0,0 @@
# - If Windows is used, this script sets the variable WIN32_WINNT to the corresponding windows version
if (WIN32)
message(STATUS "Checking windows version...")
macro(get_WIN32_WINNT version)
if (CMAKE_SYSTEM_VERSION)
set(ver ${CMAKE_SYSTEM_VERSION})
string(REGEX MATCH "^([0-9]+).([0-9])" ver ${ver})
string(REGEX MATCH "^([0-9]+)" verMajor ${ver})
# Check for Windows 10, b/c we'll need to convert to hex 'A'.
if ("${verMajor}" MATCHES "10")
set(verMajor "A")
string(REGEX REPLACE "^([0-9]+)" ${verMajor} ver ${ver})
endif ("${verMajor}" MATCHES "10")
# Remove all remaining '.' characters.
string(REPLACE "." "" ver ${ver})
# Prepend each digit with a zero.
string(REGEX REPLACE "([0-9A-Z])" "0\\1" ver ${ver})
set(${version} "0x${ver}")
endif(CMAKE_SYSTEM_VERSION)
endmacro(get_WIN32_WINNT)
endif(WIN32)

View File

@@ -4,8 +4,8 @@
# full path of the library name. in order to differentiate release and debug, this macro get the
# NAME of the variables, so the macro gets as arguments the target name and the following list of parameters
# is intended as a list of variable names each one containing the path of the libraries to link to
# The existence of a variable name with _DEBUG appended is tested and, in case it' s value is used
# for linking to when in debug mode
# The existance of a variable name with _DEBUG appended is tested and, in case it' s value is used
# for linking to when in debug mode
# the content of this library for linking when in debugging
#######################################################################################################
@@ -27,10 +27,15 @@ MACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
ENDIF()
ENDMACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
# CMAKE24: if CMake version is <2.6.0.
SET(CMAKE24 OFF)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} LESS 5)
SET(CMAKE24 ON)
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} LESS 5)
# CMAKE_VERSION_TEST: Define whether "IF(${CMAKE_VERSION} VERSION_LESS "x.y.z")" can be used or not.
BUILDER_VERSION_GREATER(2 8 0)
SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.8.0
BUILDER_VERSION_GREATER(2 6 3)
SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.6.4
SET(VALID_BUILDER_VERSION OFF)
@@ -38,13 +43,9 @@ SET(VALID_BUILDER_VERSION OFF)
MACRO(LINK_WITH_VARIABLES TRGTNAME)
FOREACH(varname ${ARGN})
IF(${varname}_DEBUG)
IF(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}")
ELSE(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
ENDIF(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
ELSE(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} ${${varname}} )
TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" )
ENDIF(${varname}_DEBUG)
ENDFOREACH(varname)
ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)
@@ -82,16 +83,16 @@ ENDMACRO(LINK_EXTERNAL TRGTNAME)
MACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
#SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES})
SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${EGL_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF()
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
LINK_WITH_VARIABLES(${CORELIB_NAME} OPENTHREADS_LIBRARY)
IF(OPENSCENEGRAPH_SONAMES)
SET_TARGET_PROPERTIES(${CORELIB_NAME} PROPERTIES VERSION ${OPENSCENEGRAPH_VERSION} SOVERSION ${OPENSCENEGRAPH_SOVERSION})
ENDIF(OPENSCENEGRAPH_SONAMES)
ENDMACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
@@ -111,20 +112,20 @@ MACRO(SETUP_LINK_LIBRARIES)
######################################################################
#
# This set up the libraries to link to, it assumes there are two variable: one common for a group of examples or plugins
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
# they are combined in a single list checked for unicity
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
# they are combined in a single list checked for unicity
# the suffix ${CMAKE_DEBUG_POSTFIX} is used for differentiating optimized and debug
#
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
##################################################################################
SET(TARGET_LIBRARIES ${TARGET_COMMON_LIBRARIES})
FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES})
SET(TO_INSERT TRUE)
FOREACH (value ${TARGET_COMMON_LIBRARIES})
IF ("${value}" STREQUAL "${LINKLIB}")
IF (${value} STREQUAL ${LINKLIB})
SET(TO_INSERT FALSE)
ENDIF ("${value}" STREQUAL "${LINKLIB}")
ENDIF (${value} STREQUAL ${LINKLIB})
ENDFOREACH (value ${TARGET_COMMON_LIBRARIES})
IF(TO_INSERT)
LIST(APPEND TARGET_LIBRARIES ${LINKLIB})
@@ -133,8 +134,8 @@ MACRO(SETUP_LINK_LIBRARIES)
#SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES})
SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${EGL_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF()
# FOREACH(LINKLIB ${TARGET_LIBRARIES})
@@ -150,7 +151,7 @@ MACRO(SETUP_LINK_LIBRARIES)
ENDIF(TARGET_LIBRARIES_VARS)
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
#when using full path name to specify linkage, it seems that already linked libs must be specified
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDMACRO(SETUP_LINK_LIBRARIES)
@@ -211,10 +212,9 @@ ENDMACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
##########################################################################################################
MACRO(SETUP_LIBRARY LIB_NAME)
IF(GLCORE_FOUND)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
ENDIF()
IF(ANDROID)
SETUP_ANDROID_LIBRARY(${LIB_NAME})
ELSE()
SET(TARGET_NAME ${LIB_NAME} )
SET(TARGET_TARGETNAME ${LIB_NAME} )
ADD_LIBRARY(${LIB_NAME}
@@ -224,16 +224,10 @@ MACRO(SETUP_LIBRARY LIB_NAME)
${TARGET_SRC}
)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
IF(APPLE)
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
ENDIF()
IF(TARGET_LABEL)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
ENDIF(TARGET_LABEL)
IF(TARGET_LIBRARIES)
LINK_INTERNAL(${LIB_NAME} ${TARGET_LIBRARIES})
ENDIF()
@@ -244,14 +238,15 @@ MACRO(SETUP_LIBRARY LIB_NAME)
LINK_WITH_VARIABLES(${LIB_NAME} ${TARGET_LIBRARIES_VARS})
ENDIF(TARGET_LIBRARIES_VARS)
LINK_CORELIB_DEFAULT(${LIB_NAME})
ENDIF()
INCLUDE(ModuleInstall OPTIONAL)
ENDMACRO(SETUP_LIBRARY LIB_NAME)
MACRO(SETUP_PLUGIN PLUGIN_NAME)
IF(GLCORE_FOUND)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
ENDIF()
IF(ANDROID)
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
ELSE()
SET(TARGET_NAME ${PLUGIN_NAME} )
@@ -269,54 +264,42 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
## plugins gets put in libopenscenegraph by default
IF(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1})
# add cpack config variables for plugin with own package
IF(BUILD_OSG_PACKAGES)
IF("${CPACK_GENERATOR}" STREQUAL "DEB")
STRING(TOUPPER ${PACKAGE_COMPONENT} UPPER_PACKAGE_COMPONENT)
SET(CPACK_${UPPER_PACKAGE_COMPONENT}_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the ${PACKAGE_COMPONENT} package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_${UPPER_PACKAGE_COMPONENT}_CONFLICTS
""
CACHE STRING
"Conflicting packages for the ${PACKAGE_COMPONENT} package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
ENDIF()
ENDIF()
ELSE(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph)
ENDIF(${ARGC} GREATER 1)
# Add the VisualStudio versioning info
# Add the VisualStudio versioning info
SET(TARGET_SRC ${TARGET_SRC} ${OPENSCENEGRAPH_VERSIONINFO_RC})
# here we use the command to generate the library
# here we use the command to generate the library
IF (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
ELSE (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
ENDIF(DYNAMIC_OPENSCENEGRAPH)
IF(MSVC)
#not sure if needed, but for plugins only Msvc need the d suffix
IF(NOT MSVC)
IF(NOT UNIX)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
ENDIF(NOT UNIX)
ELSE(NOT MSVC)
IF(NOT CMAKE24)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removed
ELSE(NOT CMAKE24)
IF(OSG_MSVC_VERSIONED_DLL)
IF(OSG_MSVC_VERSIONED_DLL)
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack
#the dll are placed in bin/${OSG_PLUGINS}
#the dll are placed in bin/${OSG_PLUGINS}
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE)
@@ -330,39 +313,26 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
ENDIF(OSG_MSVC_VERSIONED_DLL)
ENDIF(NOT CMAKE24)
ENDIF(MSVC)
ENDIF(NOT MSVC)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES()
#the installation path are differentiated for win32 that install in bin versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
IF(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ELSE( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ENDIF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
ELSE(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
ENDIF(WIN32)
ENDIF()
ENDMACRO(SETUP_PLUGIN)
@@ -372,10 +342,6 @@ ENDMACRO(SETUP_PLUGIN)
MACRO(SETUP_EXE IS_COMMANDLINE_APP)
#MESSAGE("in -->SETUP_EXE<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
IF(GLCORE_FOUND)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
ENDIF()
IF(NOT TARGET_TARGETNAME)
SET(TARGET_TARGETNAME "${TARGET_DEFAULT_PREFIX}${TARGET_NAME}")
ENDIF(NOT TARGET_TARGETNAME)
@@ -384,11 +350,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ENDIF(NOT TARGET_LABEL)
IF(${IS_COMMANDLINE_APP})
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${TARGET_SRC} ${TARGET_H})
ELSE(${IS_COMMANDLINE_APP})
IF(APPLE)
# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
# Short Version is the "marketing version". It is the version
@@ -397,8 +363,6 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
# Bundle version is the version the OS looks at.
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openscenegraph.${TARGET_TARGETNAME}" )
# replace underscore by hyphen
STRING(REGEX REPLACE "_" "-" MACOSX_BUNDLE_GUI_IDENTIFIER ${MACOSX_BUNDLE_GUI_IDENTIFIER})
SET(MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}" )
# SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
# SET(MACOSX_BUNDLE_COPYRIGHT "")
@@ -418,7 +382,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ENDIF(APPLE)
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H})
ENDIF(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
@@ -432,14 +396,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES()
SETUP_LINK_LIBRARIES()
ENDMACRO(SETUP_EXE)
@@ -453,19 +410,15 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
ELSE(${ARGC} GREATER 1)
SET(IS_COMMANDLINE_APP 0)
ENDIF(${ARGC} GREATER 1)
SETUP_EXE(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Applications")
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
IF(MSVC)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE)
ENDMACRO(SETUP_APPLICATION)
@@ -486,19 +439,15 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
ELSE(${ARGC} GREATER 1)
SET(IS_COMMANDLINE_APP 0)
ENDIF(${ARGC} GREATER 1)
SETUP_EXE(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Examples")
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
IF(MSVC)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE)
ENDMACRO(SETUP_EXAMPLE)
@@ -534,7 +483,7 @@ MACRO(HANDLE_MSVC_DLL)
ENDIF(${ARGC} GREATER 1)
SET_OUTPUT_DIR_PROPERTY_260(${LIB_NAME} "") # Ensure the /Debug /Release are removed
IF(NOT MSVC_IDE)
IF(NOT MSVC_IDE)
IF (NOT CMAKE24)
BUILDER_VERSION_GREATER(2 8 0)
IF(NOT VALID_BUILDER_VERSION)
@@ -567,12 +516,8 @@ MACRO(HANDLE_MSVC_DLL)
ELSE (NOT CMAKE24)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
ENDIF (NOT CMAKE24)
ENDIF(NOT MSVC_IDE)
ENDIF(NOT MSVC_IDE)
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDMACRO(HANDLE_MSVC_DLL)
MACRO(REMOVE_CXX_FLAG flag)
STRING(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDMACRO()

110802
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
OpenSceneGraph Public License, Version 1.0
OpenSceneGraph Public License, Version 0.0
==========================================
Copyright (C) 2018 Robert Osfield.
Copyright (C) 2002 Robert Osfield.
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
@@ -12,19 +12,18 @@
This library is free software; you can redistribute it and/or modify it
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
or later.
Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1,
with the 4 exceptions laid out in the wxWindows section below. The LGPL is
contained in the final section of this license.
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
out in the wxWindows section below. The LGPL is contained in the
final section of this license.
-------------------------------------------------------------------------------
wxWindows Library Licence, Version 3
====================================
wxWindows Library Licence, Version 3.1
======================================
Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
@@ -44,20 +43,20 @@
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA.
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxWindows Library Licence, applying
either version 3.1 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version
3.1 of the Licence document.
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under your own terms, binary object code versions of works based
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
@@ -72,13 +71,11 @@
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
------------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -89,7 +86,7 @@
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -134,7 +131,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@@ -190,8 +187,8 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
@@ -225,7 +222,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
@@ -237,7 +234,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@@ -295,7 +292,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -346,7 +343,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@@ -408,7 +405,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -449,7 +446,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -501,7 +498,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -511,7 +508,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -534,8 +531,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest

950
NEWS.txt

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,27 @@
#ANDROID makefile ${MODULE_NAME}
#ANDROID makefile ${MODULE_NAME}
LOCAL_PATH := ${MODULE_DIR}
LOCAL_PATH := ${MODULE_DIR}
include $(CLEAR_VARS)
ifeq (${ANDROID_OPTIM_NEON},true)
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_ARM_NEON := true
endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_ARM_NEON := true
endif
ifeq (${ANDROID_OPTIM_ARM32},true)
LOCAL_ARM_MODE := arm
endif
LOCAL_CPP_EXTENSION := ${CPP_EXTENSION}
LOCAL_LDLIBS := ${MODULE_LIBS}
LOCAL_CPP_EXTENSION := ${CPP_EXTENSION}
LOCAL_MODULE := ${MODULE_NAME}
LOCAL_LDLIBS := ${MODULE_LIBS_FLAGS}
LOCAL_SRC_FILES := ${MODULE_SOURCES}
LOCAL_MODULE := ${MODULE_NAME}
LOCAL_C_INCLUDES := ${MODULE_INCLUDES}
LOCAL_SRC_FILES := ${MODULE_SOURCES}
LOCAL_CFLAGS := ${MODULE_FLAGS_C}
LOCAL_C_INCLUDES := ${MODULE_INCLUDES}
LOCAL_CFLAGS := ${MODULE_FLAGS_C}
LOCAL_CPPFLAGS := ${MODULE_FLAGS_CPP}
LOCAL_SHARED_LIBRARIES := ${MODULE_LIBS_SHARED}
LOCAL_STATIC_LIBRARIES := ${MODULE_LIBS_STATIC}
LOCAL_CPPFLAGS := ${MODULE_FLAGS_CPP}
#include $(BUILD_STATIC_LIBRARY)
include ${MODULE_BUILD_TYPE}

View File

@@ -3,5 +3,5 @@
package="com.openscenegraph"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
</manifest>

View File

@@ -2,14 +2,14 @@
APP_BUILD_SCRIPT := $(call my-dir)/Android.mk
APP_PROJECT_PATH := $(call my-dir)
APP_OPTIM := ${ANDROID_RELEASE_OPTIM}
APP_OPTIM := release
APP_PLATFORM := android-${ANDROID_PLATFORM}
APP_STL := ${ANDROID_STL}
APP_PLATFORM := android-5
APP_STL := gnustl_static
APP_CPPFLAGS := -fexceptions -frtti
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums
#APP_CPPFLAGS := -Wl,--no-undefined
APP_ABI := ${ANDROID_ABI}
APP_ABI := armeabi armeabi-v7a
APP_MODULES := $ENV{AND_OSG_LIB_NAMES}

File diff suppressed because it is too large Load Diff

125
README.md
View File

@@ -1,125 +0,0 @@
[![Build Status](https://travis-ci.org/openscenegraph/OpenSceneGraph.svg?branch=master)](https://travis-ci.org/openscenegraph/OpenSceneGraph)
[![Coverity Status](https://scan.coverity.com/projects/9159/badge.svg)](https://scan.coverity.com/projects/openscenegraph-openscenegraph)
[![Documentation](https://codedocs.xyz/openscenegraph/OpenSceneGraph.svg)](https://codedocs.xyz/openscenegraph/OpenSceneGraph/)
[ABI Tracker](https://abi-laboratory.pro/tracker/timeline/openscenegraph/ "ABI Tracker")
# Introduction
Welcome to the OpenSceneGraph (OSG).
For information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website:
http://www.openscenegraph.org/index.php/documentation
For support please use the github OpenSceneGraph Discussions forum:
https://github.com/openscenegraph/OpenSceneGraph/discussions
For the impatient, we've included quick build instructions below, these are are broken down is three parts:
1) General notes on building the OpenSceneGraph
2) macOS release notes
3) iOS release notes
If details below are not sufficient then head over to the openscenegraph.org to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for more indepth instructions.
Robert Osfield.
Project Lead.
31th January 2020.
---
## Section 1. How to build OpenSceneGraph
If you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install OpenSceneGraph from source with CMake integration using a single command:
```
vcpkg install osg
```
The OpenSceneGraph uses the CMake build system to generate a platform-specific build environment. CMake reads the `CMakeLists.txt` files that you'll find throughout the OpenSceneGraph directories, checks for installed dependencies and then generates files for the selected build system.
If you don't already have CMake installed on your system you can grab it from http://www.cmake.org, use version 2.8.0 or later. Details on the OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under Unix-like systems (i.e. Linux, IRIX, Solaris, Free-BSD, HP-UX, AIX, macOS) use the `cmake` or `ccmake` command-line utils. Note that `cmake .` defaults to building Release to ensure that you get the best performance from your final libraries/applications.
cd OpenSceneGraph
cmake .
make
sudo make install
Alternatively, you can create an out-of-source build directory and run cmake or ccmake from there. The advantage to this approach is that the temporary files created by CMake won't clutter the OpenSceneGraph source directory, and also makes it possible to have multiple independent build targets by creating multiple build directories. In a directory alongside the OpenSceneGraph use:
mkdir build
cd build
cmake ../OpenSceneGraph
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio files. The following page on our wiki dedicated to the CMake build system should help guide you through the process:
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
Under macOS you can either use the CMake build system above, or use the Xcode projects that you will find in the OpenSceneGraph/Xcode directory. See release notes on macOS CMake build below.
For further details on compilation, installation and platform-specific information read "Getting Started" guide:
http://www.openscenegraph.org/index.php/documentation/10-getting-started
## Section 2. Release notes on macOS build, by Eric Sokolowski et al.
There are two ways to compile OpenSceneGraph under macOS. The recommended way is to use CMake to generate Xcode project files and then use Xcode to build the library. The default project will be able to build Debug or Release libraries, examples, and sample applications.
The alternative is to build OpenSceneGraph from the command line using `make` or `ninja` using the instructions for Unix-like systems above.
Here are some key settings to consider when using CMake:
- BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on to compile many great example programs.
- CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables, libraries, and frameworks that can be run on more than one architecture. Use this setting to indicate the architectures on which to build OSG. x86_64 is the only supported value for OS versions > 10.7.
- OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are created for the examples and sample applications. Turn this option on if you want to create real macOS .app bundles. There are caveats to creating `.app` bundles, see below.
- OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX - By default macOS uses the `imageio` plugin instead of the plugins for the individual file types (e.g. `jpg`, `gif`, etc.) to load image file types. The `imageio` plugin can handle all popular file formats through the ImageIO framework.
- OSG_WINDOWING_SYSTEM - You have the choice to use Cocoa, Carbon, or X11 when building applications on macOS. Cocoa is the default for OS versions >= 10.5. Carbon and X11 are no longer actively supported, either by Apple or the OSG community.
### APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the executable file. They do not contain the dependent libraries as would a normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable OSG_LIBRARY_PATH may be set to point to the location where the plugin .so files are located. OSG_FILE_PATH may be set to point to the location where data files are located. Setting OSG_FILE_PATH to the OpenSceneGraph-Data directory is very useful when testing OSG by running the example programs.
Many of the example programs use command-line arguments. When double-clicking on an application (or using the equivalent "open" command on the command line) only those examples and applications that do not require command-line arguments will successfully run. The executable file within the .app bundle can be run from the command-line if command-line arguments are needed.
## Section 3. Release notes on iOS build, by Thomas Hogarth
With CMake 3.11, XCode 9.4 and the iOS sdk 11.4 installed you can generate an iOS XCode project using the following command line:
export THIRDPARTY_PATH=/path/to/3rdParty
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-DIPHONE_SDKVER="11.4" \
-DIPHONE_VERSION_MIN="10.0" \
-DOPENGL_PROFILE:STRING=GLES3 \
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
-DBUILD_OSG_EXAMPLES:BOOL=ON \
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-DDYNAMIC_OPENTHREADS:BOOL=OFF \
-DCURL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/curl-ios-device/include" \
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreetype2.a" \
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 11.4. IPHONE_VERSION_MIN controls the deployment sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team.
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.

214
README.txt Normal file
View File

@@ -0,0 +1,214 @@
Welcome to the OpenSceneGraph (OSG).
For up-to-date information on the project, in-depth details on how to
compile and run libraries and examples, see the documentation on the
OpenSceneGraph website:
http://www.openscenegraph.org
For support subscribe to our public mailing list:
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
or forum:
http://forum.openscenegraph.org/
For the impatient, we've included quick build instructions below, these
are are broken down is three parts:
1) General notes on building the OpenSceneGraph
2) OSX release notes
3) iOS release notes
If details below are not sufficient then head over to the openscenegraph.org
to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for
more indepth instructions.
Robert Osfield.
Project Lead.
31st July 2011.
--
Section 1. How to build the OpenSceneGraph
==========================================
The OpenSceneGraph uses the CMake build system to generate a
platform-specific build environment. CMake reads the CMakeLists.txt
files that you'll find throughout the OpenSceneGraph directories,
checks for installed dependenciesand then generates the appropriate
build system.
If you don't already have CMake installed on your system you can grab
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
use the cmake or ccmake command-line utils, or use the included tiny
configure script that'll run cmake for you. The configure script
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
get the best performance from your final libraries/applications.
cd OpenSceneGraph
./configure
make
sudo make install
Alternatively, you can create an out-of-source build directory and run
cmake or ccmake from there. The advantage to this approach is that the
temporary files created by CMake won't clutter the OpenSceneGraph
source directory, and also makes it possible to have multiple
independent build targets by creating multiple build directories. In a
directory alongside the OpenSceneGraph use:
mkdir build
cd build
cmake ../OpenSceneGraph -DCMAKE_BUILD_TYPE=Release
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio
files. The following page on our wiki dedicated to the CMake build
system should help guide you through the process:
http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
directory. See release notes on OSX CMake build below.
For further details on compilation, installation and platform-specific
information read "Getting Started" guide:
http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted
Section 2. Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
=========================================================================
There are several ways to compile OpenSceneGraph under OSX. The
recommended way is to use CMake 2.6 to generate Xcode projects, then use
Xcode to build the library. The default project will be able to build
Debug or Release libraries, examples, and sample applications. Here are
some key settings to consider when using CMake:
BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on
to compile many great example programs.
CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables,
libraries, and frameworks that can be run on more than one architecture.
Use this setting to indicate the architectures on which to build OSG.
Possibilities include ppc, ppc64, i386, and x86_64. Building OSG using
either of the 64-bit options (ppc64 and x86_64) has its own caveats
below.
OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are
created for the examples and sample applications. Turn this option on if
you want to create real OSX .app bundles. There are caveats to creating
.app bundles, see below.
OSG_WINDOWING_SYSTEM - You have the choice to use Carbon or X11 when
building applications on OSX. Under Leopard and later, X11 applications,
when started, will automatically launch X11 when needed. However,
full-screen X11 applications will still show the menu bar at the top of
the screen. Since many parts of the Carbon user interface are not
64-bit, X11 is the only supported option for OSX applications compiled
for ppc64 or x86_64.
There is an Xcode directory in the base of the OSG software
distribution, but its future is limited, and will be discontinued once
the CMake project generator completely implements its functionality.
APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the
executable file. They do not contain the dependent libraries as would a
normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable
OSG_LIBRARY_PATH may be set to point to the location where the plugin
.so files are located. OSG_FILE_PATH may be set to point to the location
where data files are located. Setting OSG_FILE_PATH to the
OpenSceneGraph-Data directory is very useful when testing OSG by running
the example programs.
Many of the example programs use command-line arguments. When
double-clicking on an application (or using the equivalent "open"
command on the command line) only those examples and applications that
do not require command-line arguments will successfully run. The
executable file within the .app bundle can be run from the command-line
if command-line arguments are needed.
64-BIT APPLICATION SUPPORT
OpenSceneGraph will not compile successfully when OSG_WINDOWING_SYSTEM is
Carbon and either x86_64 or ppc64 is selected under CMAKE_OSX_ARCHITECTURES,
as Carbon is a 32bit only API. A version of the osgviewer library written in
Cocoa is needed. However, OSG may be compiled under 64-bits if the X11
windowing system is selected. However, Two parts of the OSG default
distribution will not work with 64-bit X11: the osgviewerWX example
program and the osgdb_qt (Quicktime) plugin. These must be removed from
the Xcode project after Cmake generates it in order to compile with
64-bit architectures. The lack of the latter means that images such as
jpeg, tiff, png, and gif will not work, nor will animations dependent on
Quicktime. A new ImageIO-based plugin is being developed to handle the
still images, and a QTKit plugin will need to be developed to handle
animations.
Section 3. Release notes on iOS build, by Thomas Hoghart
=========================================================
* Run CMake with either OSG_BUILD_PLATFORM_IPHONE or OSG_BUILD_PLATFORM_IPHONE_SIMULATOR set:
$ mkdir build-iOS ; cd build-iOS
$ ccmake -DOSG_BUILD_PLATFORM_IPHONE_SIMULATOR=YES -G Xcode ..
* Check that CMAKE_OSX_ARCHITECTURE is i386 for the simulator or armv6;armv7 for the device
* Disable DYNAMIC_OPENSCENEGRAPH, DYNAMIC_OPENTHREADS
This will give us the static build we need for iPhone.
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
* Change FREETYPE include and library paths to an iPhone version
(OpenFrameworks has one bundled with its distribution)
* Ensure that CMake_OSX_SYSROOT points to your iOS SDK.
* Generate the Xcode project
* Open the Xcode project
$ open OpenSceneGraph.xcodeproj
* Under Sources -> osgDB, select FileUtils.cpp and open the 'Get Info' panel, change File Type
to source.cpp.objcpp
Here's an example for the command-line:
$ cmake -G Xcode \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING="-ftree-vectorize -fvisibility-inlines-hidden -mno-thumb -arch armv6 -pipe -no-cpp-precomp -miphoneos-version-min=3.1 -mno-thumb" \
-D BUILD_OSG_APPLICATIONS:BOOL=OFF \
-D OSG_BUILD_FRAMEWORKS:BOOL=OFF \
-D OSG_WINDOWING_SYSTEM:STRING=IOS \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_OSX_ARCHITECTURES:STRING="armv6;armv7" \
-D CMAKE_OSX_SYSROOT:STRING=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk \
-D OSG_GL1_AVAILABLE:BOOL=OFF \
-D OSG_GL2_AVAILABLE:BOOL=OFF \
-D OSG_GLES1_AVAILABLE:BOOL=ON \
-D OSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
-D OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=ON \
-D OSG_GL_LIBRARY_STATIC:BOOL=OFF \
-D OSG_GL_MATRICES_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
-D DYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-D DYNAMIC_OPENTHREADS:BOOL=OFF .
Known issues:
* When Linking final app against ive plugin, you need to add -lz to
the 'Other linker flags' list.
* Apps and exes don't get created
* You can only select Simulator, or Device projects. In the XCode
project you will see both types but the sdk they link will
be the same.

View File

@@ -1,9 +1,9 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained.
*
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -26,12 +26,12 @@ int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications..");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
@@ -49,14 +49,14 @@ int main( int argc, char **argv )
{
insert = true;
}
bool extract = false;
while (arguments.read("-e") || arguments.read("--extract"))
{
extract = true;
}
bool list = false;
bool list = false;
while (arguments.read("-l") || arguments.read("--list"))
{
list = true;
@@ -93,7 +93,7 @@ int main( int argc, char **argv )
}
}
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
@@ -103,7 +103,7 @@ int main( int argc, char **argv )
arguments.writeErrorMessages(std::cout);
return 1;
}
if (archiveFilename.empty())
{
std::cout<<"Please specify an archive name using --archive filename"<<std::endl;
@@ -115,7 +115,7 @@ int main( int argc, char **argv )
std::cout<<"Please specify an operation on the archive, either --insert, --extract or --list"<<std::endl;
return 1;
}
if (insert && extract)
{
std::cout<<"Cannot insert and extract files from the archive at one time, please use either --insert or --extract."<<std::endl;
@@ -127,7 +127,7 @@ int main( int argc, char **argv )
if (insert)
{
archive = osgDB::openArchive(archiveFilename, osgDB::Archive::WRITE);
if (archive.valid())
{
for (FileNameList::iterator itr=files.begin();
@@ -135,27 +135,19 @@ int main( int argc, char **argv )
++itr)
{
std::cout<<"reading "<<*itr<<std::endl;
osg::ref_ptr<osg::Object> obj = osgDB::readRefObjectFile(*itr);
osg::ref_ptr<osg::Object> obj = osgDB::readObjectFile(*itr);
if (obj.valid())
{
std::cout<<" write to archive "<<*itr<<std::endl;
osg::Image* image = dynamic_cast<osg::Image*>(obj.get());
osg::HeightField* hf = dynamic_cast<osg::HeightField*>(obj.get());
osg::Node* node = dynamic_cast<osg::Node*>(obj.get());
osg::Shader* shader = dynamic_cast<osg::Shader*>(obj.get());
if (image) archive->writeImage(*image, *itr);
else if (hf) archive->writeHeightField(*hf, *itr);
else if (node) archive->writeNode(*node, *itr);
else if (shader) archive->writeShader(*shader, *itr);
else archive->writeObject(*obj, *itr);
archive->writeObject(*obj, *itr);
}
}
}
}
else
else
{
archive = osgDB::openArchive(archiveFilename, osgDB::Archive::READ);
if (extract && archive.valid())
{
for (FileNameList::iterator itr=files.begin();
@@ -175,7 +167,7 @@ int main( int argc, char **argv )
}
if (list && archive.valid())
{
{
std::cout<<"List of files in archive:"<<std::endl;
osgDB::Archive::FileNameList fileNames;
if (archive->getFileNames(fileNames))
@@ -187,11 +179,11 @@ int main( int argc, char **argv )
std::cout<<" "<<*itr<<std::endl;
}
}
std::cout<<std::endl;
std::cout<<"Master file "<<archive->getMasterFileName()<<std::endl;
}
return 0;
}

View File

@@ -45,20 +45,18 @@ class MyGraphicsContext {
traits->doubleBuffer = false;
traits->sharedContext = 0;
traits->pbuffer = true;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
_gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!_gc)
{
osg::notify(osg::NOTICE)<<"Failed to create pbuffer, failing back to normal graphics window."<<std::endl;
traits->pbuffer = false;
_gc = osg::GraphicsContext::createGraphicsContext(traits.get());
}
if (_gc.valid())
if (_gc.valid())
{
_gc->realize();
_gc->makeCurrent();
@@ -72,9 +70,9 @@ class MyGraphicsContext {
}
}
}
bool valid() const { return _gc.valid() && _gc->isRealized(); }
private:
osg::ref_ptr<osg::GraphicsContext> _gc;
};
@@ -97,7 +95,8 @@ public:
{
osg::ref_ptr< osg::Vec3Array > newnormals = new osg::Vec3Array;
newnormals->push_back( osg::Z_AXIS );
geometry->setNormalArray( newnormals.get(), osg::Array::BIND_OVERALL );
geometry->setNormalArray( newnormals.get() );
geometry->setNormalBinding( osg::Geometry::BIND_OVERALL );
}
}
}
@@ -122,20 +121,20 @@ public:
if (node.getStateSet()) apply(*node.getStateSet());
traverse(node);
}
virtual void apply(osg::Geode& node)
{
if (node.getStateSet()) apply(*node.getStateSet());
for(unsigned int i=0;i<node.getNumDrawables();++i)
{
osg::Drawable* drawable = node.getDrawable(i);
if (drawable && drawable->getStateSet()) apply(*drawable->getStateSet());
}
traverse(node);
}
virtual void apply(osg::StateSet& stateset)
{
// search for the existence of any texture object attributes
@@ -148,7 +147,7 @@ public:
}
}
}
void compress()
{
MyGraphicsContext context;
@@ -159,28 +158,27 @@ public:
}
osg::ref_ptr<osg::State> state = new osg::State;
state->initializeExtensionProcs();
for(TextureSet::iterator itr=_textureSet.begin();
itr!=_textureSet.end();
++itr)
{
osg::Texture* texture = const_cast<osg::Texture*>(itr->get());
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(texture);
osg::Texture3D* texture3D = dynamic_cast<osg::Texture3D*>(texture);
osg::ref_ptr<osg::Image> image = texture2D ? texture2D->getImage() : (texture3D ? texture3D->getImage() : 0);
if (image.valid() &&
if (image.valid() &&
(image->getPixelFormat()==GL_RGB || image->getPixelFormat()==GL_RGBA) &&
(image->s()>=32 && image->t()>=32))
{
texture->setInternalFormatMode(_internalFormatMode);
// need to disable the unref after apply, otherwise the image could go out of scope.
// need to disable the unref after apply, other the image could go out of scope.
bool unrefImageDataAfterApply = texture->getUnRefImageDataAfterApply();
texture->setUnRefImageDataAfterApply(false);
// get OpenGL driver to create texture from image.
texture->apply(*state);
@@ -201,10 +199,10 @@ public:
++itr)
{
osg::Texture* texture = const_cast<osg::Texture*>(itr->get());
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(texture);
osg::Texture3D* texture3D = dynamic_cast<osg::Texture3D*>(texture);
osg::ref_ptr<osg::Image> image = texture2D ? texture2D->getImage() : (texture3D ? texture3D->getImage() : 0);
if (image.valid())
{
@@ -217,11 +215,11 @@ public:
}
}
}
typedef std::set< osg::ref_ptr<osg::Texture> > TextureSet;
TextureSet _textureSet;
osg::Texture::InternalFormatMode _internalFormatMode;
};
@@ -245,7 +243,7 @@ public:
{
std::cout<<"Running FixTransparencyVisitor..."<<std::endl;
}
~FixTransparencyVisitor()
{
std::cout<<" Number of Transparent StateSet "<<_numTransparent<<std::endl;
@@ -258,20 +256,20 @@ public:
if (node.getStateSet()) isTransparent(*node.getStateSet());
traverse(node);
}
virtual void apply(osg::Geode& node)
{
if (node.getStateSet()) isTransparent(*node.getStateSet());
for(unsigned int i=0;i<node.getNumDrawables();++i)
{
osg::Drawable* drawable = node.getDrawable(i);
if (drawable && drawable->getStateSet()) isTransparent(*drawable->getStateSet());
}
traverse(node);
}
virtual bool isTransparent(osg::StateSet& stateset)
{
bool hasTranslucentTexture = false;
@@ -291,15 +289,15 @@ public:
for (unsigned int im=0;im<texture->getNumImages();++im)
{
osg::Image* image = texture->getImage(im);
if (image && image->isImageTranslucent()) hasTranslucentTexture = true;
if (image && image->isImageTranslucent()) hasTranslucentTexture = true;
}
}
}
if (hasTranslucentTexture || hasBlendFunc || hasTransparentRenderingHint || hasDepthSortBin)
{
++_numTransparent;
bool makeNonTransparent = false;
switch(_mode)
@@ -317,7 +315,7 @@ public:
makeNonTransparent = false;
break;
}
if (makeNonTransparent)
{
stateset.removeAttribute(osg::StateAttribute::BLENDFUNC);
@@ -337,7 +335,7 @@ public:
}
unsigned int _numTransparent;
unsigned int _numOpaque;
unsigned int _numOpaque;
unsigned int _numTransparentMadeOpaque;
FixTransparencyMode _mode;
};
@@ -352,7 +350,7 @@ public:
{
std::cout<<"Running PruneStateSet..."<<std::endl;
}
~PruneStateSetVisitor()
{
std::cout<<" Number of StateState removed "<<_numStateSetRemoved<<std::endl;
@@ -367,7 +365,7 @@ public:
}
traverse(node);
}
virtual void apply(osg::Geode& node)
{
if (node.getStateSet())
@@ -375,10 +373,20 @@ public:
node.setStateSet(0);
++_numStateSetRemoved;
}
for(unsigned int i=0;i<node.getNumDrawables();++i)
{
osg::Drawable* drawable = node.getDrawable(i);
if (drawable && drawable->getStateSet())
{
drawable->setStateSet(0);
++_numStateSetRemoved;
}
}
traverse(node);
}
unsigned int _numStateSetRemoved;
};
@@ -400,7 +408,8 @@ public:
{
osg::Vec4Array* colours = new osg::Vec4Array(1);
(*colours)[0].set(1.0f,1.0f,1.0f,1.0f);
geometry->setColorArray(colours, osg::Array::BIND_OVERALL);
geometry->setColorArray(colours);
geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
}
}
}
@@ -536,7 +545,7 @@ int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting between various input and output databases formats.");
@@ -549,19 +558,18 @@ int main( int argc, char **argv )
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
osg::setNotifyLevel(osg::NOTICE);
{
usage( arguments.getApplicationName().c_str(), 0 );
//arguments.getApplicationUsage()->write(std::cout);
return 1;
}
if (arguments.read("--help-env"))
{
{
arguments.getApplicationUsage()->write(std::cout, osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE);
return 1;
}
if (arguments.read("--plugins"))
{
osgDB::FileNameList plugins = osgDB::listAllAvailablePlugins();
@@ -572,23 +580,23 @@ int main( int argc, char **argv )
std::cout<<"Plugin "<<*itr<<std::endl;
}
return 0;
}
}
std::string plugin;
if (arguments.read("--plugin", plugin))
{
osgDB::outputPluginDetails(std::cout, plugin);
return 0;
}
}
std::string ext;
if (arguments.read("--format", ext))
{
plugin = osgDB::Registry::instance()->createLibraryNameForExtension(ext);
osgDB::outputPluginDetails(std::cout, plugin);
return 0;
}
}
if (arguments.read("--formats"))
{
osgDB::FileNameList plugins = osgDB::listAllAvailablePlugins();
@@ -599,8 +607,8 @@ int main( int argc, char **argv )
osgDB::outputPluginDetails(std::cout,*itr);
}
return 0;
}
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
@@ -627,19 +635,13 @@ int main( int argc, char **argv )
while (arguments.read("-e",ext))
{
std::string libName = osgDB::Registry::instance()->createLibraryNameForExtension(ext);
if (osgDB::Registry::instance()->loadLibrary(libName)==osgDB::Registry::NOT_LOADED)
{
OSG_NOTICE<<"Unable to load library : "<<libName<<std::endl;
}
osgDB::Registry::instance()->loadLibrary(libName);
}
std::string libName;
while (arguments.read("-l",libName))
{
if (osgDB::Registry::instance()->loadLibrary(libName)==osgDB::Registry::NOT_LOADED)
{
OSG_NOTICE<<"Unable to load library : "<<libName<<std::endl;
}
osgDB::Registry::instance()->loadLibrary(libName);
}
while (arguments.read("-o",str))
@@ -670,7 +672,7 @@ int main( int argc, char **argv )
oc.setRotation( from, to );
do_convert = true;
}
}
}
while (arguments.read("-s",str))
{
@@ -715,7 +717,7 @@ int main( int argc, char **argv )
do_convert = true;
}
FixTransparencyVisitor::FixTransparencyMode fixTransparencyMode = FixTransparencyVisitor::NO_TRANSPARANCY_FIXING;
std::string fixString;
while(arguments.read("--fix-transparency")) fixTransparencyMode = FixTransparencyVisitor::MAKE_OPAQUE_TEXTURE_STATESET_OPAQUE;
@@ -724,7 +726,7 @@ int main( int argc, char **argv )
if (fixString=="MAKE_OPAQUE_TEXTURE_STATESET_OPAQUE") fixTransparencyMode = FixTransparencyVisitor::MAKE_OPAQUE_TEXTURE_STATESET_OPAQUE;
if (fixString=="MAKE_ALL_STATESET_OPAQUE") fixTransparencyMode = FixTransparencyVisitor::MAKE_ALL_STATESET_OPAQUE;
};
bool pruneStateSet = false;
while(arguments.read("--prune-StateSet")) pruneStateSet = true;
@@ -737,12 +739,12 @@ int main( int argc, char **argv )
bool smooth = false;
while(arguments.read("--smooth")) { smooth = true; }
bool addMissingColours = false;
while(arguments.read("--addMissingColours") || arguments.read("--addMissingColors")) { addMissingColours = true; }
bool do_overallNormal = false;
while(arguments.read("--overallNormal")) { do_overallNormal = true; }
while(arguments.read("--overallNormal") || arguments.read("--overallNormal")) { do_overallNormal = true; }
bool enableObjectCache = false;
while(arguments.read("--enable-object-cache")) { enableObjectCache = true; }
@@ -771,7 +773,7 @@ int main( int argc, char **argv )
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
}
std::string fileNameOut("converted.osgt");
std::string fileNameOut("converted.osg");
if (fileNames.size()>1)
{
fileNameOut = fileNames.back();
@@ -780,89 +782,52 @@ int main( int argc, char **argv )
osg::Timer_t startTick = osg::Timer::instance()->tick();
typedef std::vector< osg::ref_ptr<osg::Image> > Images;
typedef std::vector< osg::ref_ptr<osg::Node> > Nodes;
typedef std::vector< osg::ref_ptr<osg::Object> > Objects;
osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles(fileNames);
Images images;
Nodes nodes;
Objects objects;
for(FileNameList::iterator itr = fileNames.begin();
itr != fileNames.end();
++itr)
if (root.valid())
{
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(*itr);
if (object.valid())
{
if (object->asNode()) nodes.push_back(object->asNode());
else if (object->asImage()) images.push_back(object->asImage());
else objects.push_back(object);
}
}
if (images.empty() && nodes.empty() && objects.empty())
{
osg::notify(osg::NOTICE)<<"Warning: failed to load any files"<<std::endl;
return 1;
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
}
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
osg::ref_ptr<osg::Node> root;
if (nodes.size()==1) root = nodes.front();
else if (nodes.size()>1)
if (pruneStateSet)
{
osg::ref_ptr<osg::Group> group = new osg::Group;
for(Nodes::iterator itr = nodes.begin();
itr != nodes.end();
++itr)
{
group->addChild(itr->get());
}
PruneStateSetVisitor pssv;
root->accept(pssv);
}
root = group;
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
{
FixTransparencyVisitor atv(fixTransparencyMode);
root->accept(atv);
}
if ( root.valid() )
{
if (pruneStateSet)
{
PruneStateSetVisitor pssv;
root->accept(pssv);
}
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
{
FixTransparencyVisitor atv(fixTransparencyMode);
root->accept(atv);
}
if (smooth)
{
osgUtil::SmoothingVisitor sv;
root->accept(sv);
}
}
if (addMissingColours)
{
AddMissingColoursToGeometryVisitor av;
root->accept(av);
}
// optimize the scene graph, remove redundant nodes and state etc.
// optimize the scene graph, remove rendundent nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(root.get());
if( do_convert )
root = oc.convert( root.get() );
if (internalFormatMode != osg::Texture::USE_IMAGE_DATA_FORMAT)
{
ext = osgDB::getFileExtension(fileNameOut);
std::string ext = osgDB::getFileExtension(fileNameOut);
CompressTexturesVisitor ctv(internalFormatMode);
root->accept(ctv);
ctv.compress();
@@ -905,20 +870,6 @@ int main( int argc, char **argv )
osg::notify(osg::NOTICE)<<result.message()<< std::endl;
}
}
else if (!images.empty())
{
if (images.size()>1)
{
OSG_NOTICE<<"Warning: osgconv does not support writing multiple to a single file."<<std::endl;
return 1;
}
osgDB::writeImageFile(*images.front(), fileNameOut);
}
else if (!objects.empty())
{
osgDB::writeObjectFile(*images.front(), fileNameOut);
}
else
{
osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;

View File

@@ -1,9 +1,9 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained.
*
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -32,10 +32,7 @@
#include <signal.h>
#include <stdlib.h>
#include <OpenThreads/Atomic>
static OpenThreads::Atomic s_ExitApplication;
static OpenThreads::Atomic s_SigValue;
static bool s_ExitApplication = false;
struct Extents
{
@@ -49,20 +46,20 @@ struct Extents
_maxLevel(maxLevel),
_min(minX, minY),
_max(maxX, maxY) {}
Extents(const Extents& extents):
_maxLevel(extents._maxLevel),
_min(extents._min),
_max(extents._max) {}
Extents& operator = (const Extents& rhs)
{
if (&rhs == this) return *this;
_maxLevel = rhs._maxLevel;
_min = rhs._min;
_max = rhs._max;
return *this;
}
@@ -72,10 +69,10 @@ struct Extents
osg::notify(osg::INFO)<<" _maxLevel="<<_maxLevel<<", _min="<<_min<<" _max="<<_max<<std::endl;
if (level>_maxLevel) return false;
osg::Vec2d union_min, union_max;
// handle mins
// handle mins
if (_min.x()!=DBL_MAX && in_min.x()!=DBL_MAX)
{
// both _min.x() and in_min.x() are defined so use max of two
@@ -98,7 +95,7 @@ struct Extents
union_min.y() = _min.y()<in_min.y() ? _min.y() : in_min.y();
}
// handle maxs
// handle maxs
if (_max.x()!=-DBL_MAX && in_max.x()!=-DBL_MAX)
{
// both _max.x() and in_max.x() are defined so use max of two
@@ -124,7 +121,7 @@ struct Extents
bool result = union_min.x()<union_max.x() && union_min.y()<union_max.y() ;
osg::notify(osg::INFO)<<" union_min="<<union_min<<" union_max="<<union_max<<" result = "<<result<<std::endl;
return result;
}
@@ -133,6 +130,40 @@ struct Extents
osg::Vec2d _max;
};
class CheckValidVisitor : public osg::NodeVisitor
{
public:
CheckValidVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_numInvalidGeometries(0) {}
void apply(osg::Geode& geode)
{
unsigned int local_numInvalidGeometries = 0;
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
{
osg::Geometry* geometry = dynamic_cast<osg::Geometry*>(geode.getDrawable(i));
if (geometry)
{
if (!geometry->verifyArrays(_errorReports)) ++local_numInvalidGeometries;
}
}
if (local_numInvalidGeometries)
{
_errorReports<<"Geode "<<geode.getName()<<" contains problem geometries"<<std::endl;
_numInvalidGeometries += local_numInvalidGeometries;
}
}
bool valid() const { return _numInvalidGeometries==0; }
unsigned int _numInvalidGeometries;
std::stringstream _errorReports;
};
class LoadDataVisitor : public osg::NodeVisitor
{
public:
@@ -143,7 +174,7 @@ public:
_currentLevel(0) {}
void setFileCache(osgDB::FileCache* fileCache) { _fileCache = fileCache; }
void addExtents(unsigned int maxLevel, double minX, double minY, double maxX, double maxY)
{
_extentsList.push_back(Extents(maxLevel, minX, minY, maxX, maxY));
@@ -157,16 +188,16 @@ public:
void apply(osg::CoordinateSystemNode& cs)
{
_csnStack.push_back(&cs);
if (!s_ExitApplication) traverse(cs);
_csnStack.pop_back();
}
void apply(osg::Group& group)
{
if (s_ExitApplication) return;
osgTerrain::TerrainTile* terrainTile = dynamic_cast<osgTerrain::TerrainTile*>(&group);
osgTerrain::Locator* locator = terrainTile ? terrainTile->getLocator() : 0;
if (locator)
@@ -199,7 +230,7 @@ public:
return;
}
traverse(group);
}
@@ -220,11 +251,11 @@ public:
void apply(osg::PagedLOD& plod)
{
if (s_ExitApplication) return;
++_currentLevel;
initBound();
// first compute the bounds of this subgraph
for(unsigned int i=0; i<plod.getNumFileNames(); ++i)
{
@@ -233,7 +264,7 @@ public:
traverse(plod);
}
}
if (intersects())
{
for(unsigned int i=0; i<plod.getNumFileNames(); ++i)
@@ -242,7 +273,7 @@ public:
if (!plod.getFileName(i).empty())
{
std::string filename;
if (!plod.getDatabasePath().empty())
if (!plod.getDatabasePath().empty())
{
filename = plod.getDatabasePath() + plod.getFileName(i);
}
@@ -258,10 +289,10 @@ public:
}
}
}
--_currentLevel;
}
void apply(osg::Geode& geode)
{
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
@@ -274,11 +305,11 @@ public:
}
}
}
osg::ref_ptr<osg::Node> readNodeFileAndWriteToCache(const std::string& filename)
osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
{
osg::ref_ptr<osg::Node> node = 0;
if (_fileCache.valid() )
osg::Node* node = 0;
if (_fileCache.valid() && osgDB::containsServerAddress(filename))
{
if (_fileCache->existsInCache(filename))
{
@@ -289,7 +320,7 @@ public:
{
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
node = osgDB::readRefNodeFile(filename);
node = osgDB::readNodeFile(filename);
if (node)
{
osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl;
@@ -301,7 +332,18 @@ public:
else
{
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
node = osgDB::readRefNodeFile(filename);
node = osgDB::readNodeFile(filename);
}
if (node)
{
CheckValidVisitor cvv;
node->accept(cvv);
if (!cvv.valid())
{
OSG_NOTICE<<"Warning, errors in geometry found in file "<<filename<<std::endl;
OSG_NOTICE<<cvv._errorReports.str()<<std::endl;
}
}
return node;
}
@@ -310,18 +352,18 @@ public:
protected:
inline void pushMatrix(osg::Matrix& matrix) { _matrixStack.push_back(matrix); }
inline void popMatrix() { _matrixStack.pop_back(); }
void convertXYZToLatLongHeight(osg::EllipsoidModel* em, osg::Vec3d& v)
{
em->convertXYZToLatLongHeight(v.x(), v.y(), v.z(),
v.y(), v.x(), v.z());
v.x() = osg::RadiansToDegrees(v.x());
v.y() = osg::RadiansToDegrees(v.y());
}
void initBound()
{
_min.set(DBL_MAX, DBL_MAX);
@@ -335,16 +377,16 @@ protected:
if (v.x() > _max.x()) _max.x() = v.x();
if (v.y() > _max.y()) _max.y() = v.y();
}
void updateBound(osg::Vec3Array& vertices)
{
// set up matrix
osg::Matrix matrix;
if (!_matrixStack.empty()) matrix = _matrixStack.back();
// set up ellipsoid model
osg::EllipsoidModel* em = !_csnStack.empty() ? _csnStack.back()->getEllipsoidModel() : 0;
for(osg::Vec3Array::iterator itr = vertices.begin();
itr != vertices.end();
++itr)
@@ -355,7 +397,7 @@ protected:
updateBound(v);
}
}
bool intersects()
{
osg::notify(osg::INFO)<<"intersects() _min = "<<_min<<" _max = "<<_max<<std::endl;
@@ -365,7 +407,7 @@ protected:
{
if (itr->intersects(_currentLevel, _min, _max)) return true;
}
return false;
}
@@ -379,15 +421,15 @@ protected:
unsigned int _currentLevel;
MatrixStack _matrixStack;
CSNStack _csnStack;
osg::Vec2d _min;
osg::Vec2d _max;
};
static void signalHandler(int sig)
{
s_SigValue.exchange(sig);
s_ExitApplication.exchange(1);
printf("\nCaught signal %d, requesting exit...\n\n",sig);
s_ExitApplication = true;
}
int main( int argc, char **argv )
@@ -406,7 +448,7 @@ int main( int argc, char **argv )
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications..");
@@ -415,21 +457,21 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("-e level minX minY maxX maxY","Read down to <level> across the extents minX, minY to maxY, maxY. Note, for geocentric datase X and Y are longitude and latitude respectively.");
arguments.getApplicationUsage()->addCommandLineOption("-c directory","Shorthand for --file-cache directory.");
arguments.getApplicationUsage()->addCommandLineOption("--file-cache directory","Set directory as to place cache download files.");
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
LoadDataVisitor ldv;
std::string fileCachePath;
while(arguments.read("--file-cache",fileCachePath) || arguments.read("-c",fileCachePath)) {}
if (fileCachePath.empty())
{
{
const char* env_fileCachePath = getenv("OSG_FILE_CACHE");
if (env_fileCachePath)
{
@@ -442,7 +484,7 @@ int main( int argc, char **argv )
std::cout<<"No path to the file cache defined, please set OSG_FILE_PATH env var, or use --file-cache <directory> to set a suitable directory for the file cache."<<std::endl;
return 1;
}
ldv.setFileCache(new osgDB::FileCache(fileCachePath));
unsigned int maxLevels = 0;
@@ -450,14 +492,14 @@ int main( int argc, char **argv )
{
ldv.addExtents(maxLevels);
}
double minX, maxX, minY, maxY;
while(arguments.read("-e",maxLevels, minX, minY, maxX, maxY))
{
ldv.addExtents(maxLevels, minX, minY, maxX, maxY);
}
std::string filename;
for(int i=1; i<arguments.argc(); ++i)
{
@@ -467,26 +509,26 @@ int main( int argc, char **argv )
break;
}
}
if (filename.empty())
if (filename.empty())
{
std::cout<<"No file to load specified."<<std::endl;
return 1;
}
osg::ref_ptr<osg::Node> loadedModel = ldv.readNodeFileAndWriteToCache(filename);
if (!loadedModel)
{
std::cout<<"No data loaded, please specify a database to load"<<std::endl;
return 1;
}
loadedModel->accept(ldv);
if (s_ExitApplication)
{
std::cout<<"osgfilecache exited in response to signal : "<<s_SigValue<<std::endl;
std::cout<<"osgfilecache cleanly exited in response to signal."<<std::endl;
}
return 0;

View File

@@ -122,7 +122,6 @@ const char* invalidNames[] =
"LineStipple",
"Logos",
"LongIDRecord",
"InputIterator",
"Make",
"Makefile",
"Material",
@@ -248,43 +247,7 @@ const char* invalidNames[] =
"UpdateSkeleton",
"Vec3",
"Plugin",
"Get",
"LightSource",
"SlideEventHandler",
"GraphicsContext*",
"Apple",
"GeometryNew",
"FrameBufferObject",
"Lua",
"VolumeTile",
"PushStackValueVisitor",
"RayIntersector",
"OpenSceneGraph-Data",
"Node",
"AlphaFunc",
"CompositeViewer",
"OpenSceneGraph-3",
"DisplaySettings::SHADER_NONE",
"CodeDocs",
"Mon",
"Tue",
"Wed",
"Fri",
"Sat",
"Sun",
"I",
"TriangleFunctor",
"PrimitiveFunctor",
"OpenMW",
"StreamOperator",
"SceneLoader",
"OpenGL",
"FindLIBLAS",
"PissedCapslock",
"MinGW",
"Haojia521",
"Github",
"It"
"Get"
};
@@ -296,7 +259,6 @@ struct TypoCorrection
TypoCorrection typoCorrections[] =
{
{"Cheaev", "Chebaev"},
{"Alaxandre", "Alexandre"},
{"Aderian", "Adrian"},
{"Adndre", "Andre"},
@@ -306,7 +268,6 @@ TypoCorrection typoCorrections[] =
{"André", "Andr<EFBFBD>"},
{"Antione", "Antoine"},
{"Antonoine", "Antoine"},
{"Aurelein", "Aurelien"},
{"Atr", "Art"},
{"Baverage", "Beverage"},
{"Bistroviae", "Bistrovic"},
@@ -325,7 +286,6 @@ TypoCorrection typoCorrections[] =
{"Fabian", "Fabien"},
{"Fautre", "Fautr<EFBFBD>"},
{"Frashid", "Farshid"},
{"Farshild", "Farshid"},
{"Fred", "Frederic"},
{"Fredrick", "Frederic"},
{"Fredric", "Frederic"},
@@ -351,8 +311,6 @@ TypoCorrection typoCorrections[] =
{"Happalahti", "Haapalahti"},
{"Hertlien", "Hertlein"},
{"Hatwig", "Hartwig"},
{"Hauknes", "Haukness"},
{"Hunber", "Huber"},
{"Hi", "He"},
{"Hooper", "Hopper"},
{"Inverson", "Iverson"},
@@ -377,7 +335,6 @@ TypoCorrection typoCorrections[] =
{"Krulthof", "Kruithof"},
{"Lagrade", "Lagarde"},
{"Largade", "Lagarde"},
{"Largarde", "Lagarde"},
{"Larshkari", "Lashkari"},
{"Lashakari", "Lashkari"},
{"Lashari", "Lashkari"},
@@ -423,7 +380,6 @@ TypoCorrection typoCorrections[] =
{"Oritz", "Ortiz"},
{"Osfeld", "Osfield"},
{"Osfied", "Osfield"},
{"Paulk", "Paul"},
{"Pail", "Paul"},
{"Perciva", "Peciva"},
{"Pecvia", "Peciva"},
@@ -484,32 +440,7 @@ TypoCorrection typoCorrections[] =
{"Jahannes","Johannes"},
{"Eskland","Ekstrand"},
{"Baeuerele","Baeuerle"},
{"Bauerle","Baeuerle"},
{"Baeurele","Baeuerle"},
{"Nillson","Nilsson"},
{"Bjorn","Bj<EFBFBD>rn"},
{"Björn","Bj<EFBFBD>rn"},
{"Stepan","Stephan"},
{"Kristoger","Kristofer"},
{"Blessing","Blissing"},
{"Dannahuer","Dannhauer"},
{"Chebeav", "Chebaev"},
{"Messershmidt","Messerschmidt"},
{"Auelien","Aurelien"},
{"Aurélien","Aur<EFBFBD>lien"},
{"McDonnel","Mc Donnell"},
{"McDonnell","Mc Donnell"},
{"Delallée","Delall<EFBFBD>e"},
{"Gjøl","Gj<EFBFBD>l"},
{"Ravšelj","Rav<EFBFBD>elj"},
{"Ravsel", "Rav<EFBFBD>elj"},
{"Ravselj", "Rav<EFBFBD>elj"},
{"Janik", "Jannik"},
{"Viganò", "Vigan<EFBFBD>"},
{"Vigano", "Vigan<EFBFBD>"},
{"Frashud", "Farshid"},
{"Dannahauer","Dannahauer"},
{"Sando","Sandro"}
{"Bauerle","Baeuerle"}
};
@@ -523,40 +454,18 @@ struct NameCorrection
NameCorrection nameCorrections[] =
{
{"LaurensVoerman","GetScalarValue",
"Laurens", "Voerman"},
{"LaurensVoerman","Meta_Shape",
"Laurens", "Voerman"},
{"LaurensVoerman","OpenCascade",
"Laurens", "Voerman"},
{"LaurensVoerman","Fri",
"Laurens", "Voerman"},
{"LaurensVoerman","",
"Laurens", "Voerman"},
{"Laurens","Loerman",
"Laurens", "Voerman"},
{"FrancoisTigeot","",
"Francois", "Tigeot"},
{"Juan","Manuel",
"Juan", "Manuel Alvarez"},
{"Jaap","Gas",
"Jaap", "Glas"},
{"Philip","Lamp",
"Philip", "Lamb"},
{"Dimi","Christop",
"Dimi", "Christopoulos"},
{"Jorge","Ciges",
"Jorge", "Izquierdo Ciges"},
{"Jorge","Izquierdo",
"Jorge", "Izquierdo Ciges"},
"Jorge", "Izquierdo"},
{"Rafa","Gata",
"Rafa", "Gaitan"},
{"Sukender","I",
"Sukender", ""},
{"Sukender","Here",
"Sukender", ""},
{"Sukender","Fix",
"Sukender", ""},
{"Ewe","Woessner",
"Uwe", "Woessner"},
{"Martin","von",
@@ -571,8 +480,6 @@ NameCorrection nameCorrections[] =
"Thomas", "Hogarth"},
{"Marin", "Lavery",
"Martin", "Lavery"},
{"Michael", "Bach",
"Michael", "Bach Jensen"},
{"Nguyen", "Van",
"Nguyen", "Van Truong"},
{"Thom", "Carlo",
@@ -629,8 +536,6 @@ NameCorrection nameCorrections[] =
"Melchior", "Franz"},
{"Glen", "Waldon",
"Glenn", "Waldron"},
{"Glen", "Waldron",
"Glenn", "Waldron"},
{"Ralf", "Karn",
"Ralf", "Kern"},
{"Donny", "Cipperly",
@@ -663,12 +568,8 @@ NameCorrection nameCorrections[] =
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Rommano", "Silva",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Romano", "Magacho",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Leandro", "Motta",
"Leandro", "Motta Barros"},
{"Leandro", "Motto",
"Leandro", "Motta Barros"},
{"A", "Botorabi",
"Ali", "Botorabi"},
{"Waltice", "",
@@ -685,34 +586,10 @@ NameCorrection nameCorrections[] =
"Luc", "Frauciel"},
{"Alberto", "Lucas",
"Alberto", "Luaces"},
{"Alberto", "Luacus",
"Alberto", "Luaces"},
{"Tyge", "",
"Tyge", "L<EFBFBD>vset"},
{"Ricard", "Schmidt",
"Richard", "Schmidt"},
{"Matthias", "Helsing",
"Mattias", "Helsing"},
{"Clement", "Boesch",
"Cl<EFBFBD>ment", "B<EFBFBD>sch"},
{"Lauren", "Voerman",
"Laurens", "Voerman"},
{"Pjotr", "Sventachov",
"Pjotr", "Svetachov"},
{"Bradley", "Baker",
"Bradley", "Baker Searles"},
{"PawelKsiezopolski", "",
"Pawel", "Ksiezopolski"},
{"Albert", "Luaces",
"Alberto","Luaces"},
{"KOS", "",
"Konstantin","Matveyev"},
{"WeSee", "",
"Alois", "Wismer"},
{"We", "See",
"Alois", "Wismer"},
{"AnyOldName3", "",
"Chris", "Djali"}
"Richard", "Schmidt"}
};
@@ -1044,9 +921,7 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
cout << "-------------------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{
cout << sitr->first << "\t" << sitr->second.first;
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
cout << endl;
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
}
}
else
@@ -1055,9 +930,7 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
cout << "-----------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{
cout << sitr->second.first;
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
cout << endl;
cout << sitr->second.first << " " << sitr->second.second << endl;
}
}
}

View File

@@ -1,5 +1,5 @@
// The majority of the application is dedicated to building the
// current contributors list by parsing the ChangeLog, it just takes
// current contribitors list by parsing the ChangeLog, it just takes
// one line in the main itself to report the version number.
#include <set>
@@ -17,7 +17,6 @@
#include <osg/Plane>
#include <osg/BoundingBox>
#include <osg/BoundingSphere>
#include <osg/Quat>
#ifdef BUILD_CONTRIBUTORS
extern void printContributors(const std::string& changeLog, bool printNumEntries);
@@ -41,7 +40,6 @@ int main( int argc, char** argv)
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
arguments.getApplicationUsage()->addCommandLineOption("Quat::value_type", "Print the value of Quat::value_type");
#ifdef BUILD_CONTRIBUTORS
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
@@ -141,12 +139,6 @@ int main( int argc, char** argv)
return 0;
}
if (arguments.read("Quat::value_type"))
{
cout << ((sizeof(osg::Quat::value_type) == 4) ? "float" : "double") << endl;
return 0;
}
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
#ifdef BUILD_CONTRIBUTORS

View File

@@ -14,7 +14,6 @@
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
@@ -29,11 +28,8 @@
#include <osgGA/TerrainManipulator>
#include <osgGA/SphericalManipulator>
#include <osgGA/Device>
#include <iostream>
int main(int argc, char** argv)
{
// use an ArgumentParser object to manage the program arguments.
@@ -45,10 +41,6 @@ int main(int argc, char** argv)
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
arguments.getApplicationUsage()->addCommandLineOption("--stats","print out load and compile timing stats");
osgViewer::Viewer viewer(arguments);
@@ -72,24 +64,16 @@ int main(int argc, char** argv)
return 1;
}
bool printStats = arguments.read("--stats");
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
osgDB::Registry::instance()->getOrCreateAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
std::string device;
while(arguments.read("--device", device))
{
osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device);
if (dev.valid())
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
viewer.addDevice(dev);
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
@@ -112,7 +96,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm && !apm->getAnimationPath()->empty())
if (apm || !apm->valid())
{
apm->setTimeScale(animationSpeed);
@@ -150,25 +134,14 @@ int main(int argc, char** argv)
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
osg::ElapsedTime elapsedTime;
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}
if (printStats)
{
double loadTime = elapsedTime.elapsedTime_m();
std::cout<<"Load time "<<loadTime<<"ms"<<std::endl;
viewer.getStats()->collectStats("compile", true);
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
@@ -182,9 +155,9 @@ int main(int argc, char** argv)
// optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel);
optimizer.optimize(loadedModel.get());
viewer.setSceneData(loadedModel);
viewer.setSceneData( loadedModel.get() );
viewer.realize();

View File

@@ -54,7 +54,7 @@ IF (NOT DYNAMIC_OPENSCENEGRAPH)
osgdb_openflight
osgdb_obj
)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
osgdb_deprecated_osg osgdb_deprecated_osgparticle osgdb_deprecated_osganimation
osgdb_deprecated_osgfx osgdb_deprecated_osgsim osgdb_deprecated_osgtext

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include "Cluster.h"
@@ -16,9 +15,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <errno.h>
#if !defined (_WIN32) || defined(__CYGWIN__)
#if !defined (WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/socket.h>
@@ -35,23 +33,21 @@
#if defined(__linux)
#include <unistd.h>
#include <linux/sockios.h>
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
#elif defined(__FreeBSD__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined(__sgi)
#include <unistd.h>
#include <net/soioctl.h>
#elif defined(__CYGWIN__)
#elif defined(__CYGWIN__)
#include <unistd.h>
#elif defined (__GNU__)
#include <unistd.h>
#elif defined(__sun)
#elif defined(__sun)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (__APPLE__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (_WIN32)
#elif defined (WIN32)
#include <winsock.h>
#include <stdio.h>
#elif defined (__hpux)
@@ -63,7 +59,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#else
#include <unistd.h>
@@ -206,8 +202,7 @@ void DataConverter::write(CameraPacket& cameraPacket)
itr != cameraPacket._events.end();
++itr)
{
osgGA::GUIEventAdapter* event = (*itr)->asGUIEventAdapter();
if (event) write(*(event));
write(*(*itr));
}
}
@@ -254,7 +249,7 @@ void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
//////////////////////////////////////////////////////////////////////////////
//
// Receiver
// Reciever
//
Receiver::Receiver( void )
{
@@ -265,7 +260,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void )
{
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -274,7 +269,7 @@ Receiver::~Receiver( void )
bool Receiver::init( void )
{
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@@ -292,27 +287,18 @@ bool Receiver::init( void )
perror( "Socket" );
return false;
}
int result = 0;
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else
int on = 1;
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#endif
if (result)
{
OSG_NOTICE<<"Warning: Receiver::init() setsockopt(..) failed, errno="<<errno<<std::endl;
return false;
}
// struct sockaddr_in saddr;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
#else
saddr.sin_addr.s_addr = 0;
@@ -350,9 +336,8 @@ void Receiver::sync( void )
return;
}
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \
defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
socklen_t
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ )
socklen_t
#else
int
#endif
@@ -366,19 +351,13 @@ void Receiver::sync( void )
tv.tv_sec = 0;
tv.tv_usec = 0;
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port );
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
//int err = WSAGetLastError ();
//int *dum = (int*) _buffer;
if (result<0)
{
OSG_NOTICE<<"Warning: Receiver::sync() recvfrom(..) failed, errno="<<errno<<std::endl;
return;
}
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{
if( FD_ISSET( _so, &fdset ) )
@@ -387,13 +366,7 @@ void Receiver::sync( void )
}
}
#else
int result = recvfrom( _so, (caddr_t)_buffer, _buffer_size, 0, 0, &size );
if (result<0)
{
OSG_NOTICE<<"Warning: Receiver::sync() recvfrom(..) failed, errno="<<errno<<std::endl;
return;
}
recvfrom( _so, (caddr_t)_buffer, _buffer_size, 0, 0, &size );
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{
if( FD_ISSET( _so, &fdset ) )
@@ -407,7 +380,7 @@ void Receiver::sync( void )
//////////////////////////////////////////////////////////////////////////////
//
// Broadcaster
// Broadcaster
//
Broadcaster::Broadcaster( void )
{
@@ -419,7 +392,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void )
{
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -428,7 +401,7 @@ Broadcaster::~Broadcaster( void )
bool Broadcaster::init( void )
{
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@@ -446,44 +419,39 @@ bool Broadcaster::init( void )
perror( "Socket" );
return false;
}
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
const BOOL on = TRUE;
#else
int on = 1;
#endif
int result = 0;
#if defined (_WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#if defined (WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#endif
if (result) return false;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
if( _address == 0 )
{
#if defined (_WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#if defined (WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif
if (result) return false;
#if !defined (_WIN32) || defined(__CYGWIN__)
#if !defined (WIN32) || defined(__CYGWIN__)
struct ifreq ifr;
#endif
#if defined (__linux) || defined(__CYGWIN__)
strcpy( ifr.ifr_name, "eth0" );
#elif defined(__sun)
strcpy( ifr.ifr_name, "hme0" );
#elif !defined (_WIN32)
#elif !defined (WIN32)
strcpy( ifr.ifr_name, "ef0" );
#endif
#if defined (_WIN32) // get the server address
#if defined (WIN32) // get the server address
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
}
#else
@@ -542,19 +510,14 @@ void Broadcaster::sync( void )
return;
}
int result = 0;
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN );
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
// int err = WSAGetLastError ();
// int *dum = (int*) _buffer;
#else
unsigned int size = sizeof( struct sockaddr_in );
result = sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
#endif
if (result)
{
OSG_NOTICE<<"Warning: sentTo(...) failed : errno="<<errno<<std::endl;
}
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef CLUSTER_H
@@ -19,7 +18,7 @@
#include <osgViewer/Viewer>
#if !defined(_WIN32) || defined(__CYGWIN__)
#if !defined(WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#else
#include "winsock.h"
@@ -30,28 +29,28 @@
//
// Class definition for the recipient of a broadcasted message
//
class Receiver
class Receiver
{
public :
Receiver();
~Receiver();
Receiver();
~Receiver();
// setBuffer defines the buffer into which the broadcasted
// message will be received.
void setBuffer( void *buffer, const unsigned int size );
// setBuffer defines the buffer into which the broadcasted
// message will be received.
void setBuffer( void *buffer, const unsigned int size );
// Define what port to listen and bind to
void setPort( const short port );
// Define what port to listen and bind to
void setPort( const short port );
// Sync does a blocking wait to receive next message
void sync( void );
// Sync does a blocking wait to recieve next message
void sync( void );
private :
bool init( void );
bool init( void );
private :
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (WIN32) && !defined(__CYGWIN__)
SOCKET _so;
SOCKADDR_IN saddr;
#else
@@ -69,32 +68,32 @@ class Receiver
//
// Class definition for broadcasting a buffer to a LAN
//
class Broadcaster
class Broadcaster
{
public :
Broadcaster( void );
~Broadcaster( void );
Broadcaster( void );
~Broadcaster( void );
// Set the broadcast port
void setPort( const short port );
// Set the broadcast port
void setPort( const short port );
// Set the buffer to be broadcast
void setBuffer( void *buffer, const unsigned int buffer_size );
// Set the buffer to be broadcast
void setBuffer( void *buffer, const unsigned int buffer_size );
// Set a recipient host. If this is used, the Broadcaster
// no longer broadcasts, but rather directs UDP packets at
// host.
void setHost( const char *hostname );
// Set a recipient host. If this is used, the Broadcaster
// no longer broadcasts, but rather directs UDP packets at
// host.
void setHost( const char *hostname );
// Sync broadcasts the buffer
void sync( void );
// Sync broadcasts the buffer
void sync( void );
private :
bool init( void );
bool init( void );
private :
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else
int _so;
@@ -103,7 +102,7 @@ class Broadcaster
short _port;
void *_buffer;
unsigned int _buffer_size;
#if defined(_WIN32) && !defined(__CYGWIN__)
#if defined(WIN32) && !defined(__CYGWIN__)
SOCKADDR_IN saddr;
#else
struct sockaddr_in saddr;
@@ -113,15 +112,15 @@ class Broadcaster
class CameraPacket {
public:
static const unsigned int MAX_NUM_EVENTS;
static const unsigned int SWAP_BYTES_COMPARE;
CameraPacket():_masterKilled(false)
CameraPacket():_masterKilled(false)
{
_byte_order = SWAP_BYTES_COMPARE;
}
void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp)
{
_matrix = matrix;
@@ -130,20 +129,20 @@ class CameraPacket {
_frameStamp = *frameStamp;
}
}
void getModelView(osg::Matrix& matrix,float angle_offset=0.0f)
{
matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f);
}
void readEventQueue(osgViewer::Viewer& viewer);
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
bool getMasterKilled() const { return _masterKilled; }
const bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;
osg::Matrix _matrix;
@@ -151,11 +150,11 @@ class CameraPacket {
// note don't use a ref_ptr as used elsewhere for FrameStamp
// since we don't want to copy the pointer - but the memory.
// FrameStamp doesn't have a private destructor to allow
// us to do this, even though its a reference counted object.
// us to do this, even though its a reference counted object.
osg::FrameStamp _frameStamp;
osgGA::EventQueue::Events _events;
};
class DataConverter
@@ -187,22 +186,22 @@ class DataConverter
{
if (_currentPtr+1>=_endPtr) return;
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr);
}
inline void read1(char* ptr)
{
if (_currentPtr+1>=_endPtr) return;
*(ptr) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
inline void write2(char* ptr)
{
if (_currentPtr+2>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read2(char* ptr)
@@ -211,13 +210,13 @@ class DataConverter
if (_swapBytes)
{
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -225,10 +224,10 @@ class DataConverter
{
if (_currentPtr+4>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read4(char* ptr)
@@ -237,17 +236,17 @@ class DataConverter
if (_swapBytes)
{
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -255,15 +254,15 @@ class DataConverter
{
if (_currentPtr+8>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read8(char* ptr)
@@ -273,27 +272,27 @@ class DataConverter
if (_swapBytes)
{
*(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++);
*(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -306,14 +305,14 @@ class DataConverter
inline void writeFloat(float c) { write4((char*)&c); }
inline void writeDouble(double c) { write8((char*)&c); }
inline char readChar() { char c=0; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
inline short readShort() { short c=0; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
inline int readInt() { int c=0; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
inline char readChar() { char c; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
inline short readShort() { short c; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
inline int readInt() { int c; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
inline float readFloat() { float c; read4((char*)&c); return c; }
inline double readDouble() { double c; read8((char*)&c); return c; }
void write(const osg::FrameStamp& fs);
void read(osg::FrameStamp& fs);
@@ -323,13 +322,13 @@ class DataConverter
void write(const osgGA::GUIEventAdapter& event);
void read(osgGA::GUIEventAdapter& event);
void write(CameraPacket& cameraPacket);
void read(CameraPacket& cameraPacket);
char* startPtr() { return _startPtr; }
unsigned int numBytes() { return _numBytes; }
protected:
char* _startPtr;
@@ -342,4 +341,4 @@ class DataConverter
#endif
#endif

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include "ExportHTML.h"
@@ -47,16 +46,16 @@ public:
void setSnapImageOnNextFrame(bool flag) { _snapImageOnNextFrame = flag; }
bool getSnapImageOnNextFrame() const { return _snapImageOnNextFrame; }
virtual void operator () (const osg::Camera& camera) const
{
if (!_snapImageOnNextFrame) return;
int x = static_cast<int>(camera.getViewport()->x());
int y = static_cast<int>(camera.getViewport()->y());
unsigned int width = static_cast<unsigned int>(camera.getViewport()->width());
unsigned int height = static_cast<unsigned int>(camera.getViewport()->height());
osg::ref_ptr<osg::Image> image = new osg::Image;
image->readPixels(x,y,width,height,
GL_RGB,GL_UNSIGNED_BYTE);
@@ -65,16 +64,16 @@ public:
{
osg::notify(osg::NOTICE) << "Saved screen image to `"<<_filename<<"`"<< std::endl;
}
_snapImageOnNextFrame = false;
}
protected:
std::string _filename;
mutable bool _snapImageOnNextFrame;
};
std::string ExportHTML::createFileName(const std::string& basename, unsigned int page, const std::string& ext)
@@ -103,7 +102,7 @@ bool ExportHTML::write(osgPresentation::SlideEventHandler* seh, osgViewer::Viewe
image_basename = osgDB::getNameLessExtension(filename);
image_ext = ".jpg";
}
std::cout<<"Writing slides to "<<image_basename<<"_[slidenumber]"<<image_ext<<std::endl;
osg::ref_ptr<SnapImageDrawCallback> sidc = new SnapImageDrawCallback;
@@ -170,7 +169,7 @@ bool ExportHTML::write(osgPresentation::SlideEventHandler* seh, osgViewer::Viewe
}
fout<<"</tr>"<<std::endl;
fout<<"</table>"<<std::endl;
fout<<"<img src=\""<<osgDB::getSimpleFileName(os.str())<<"\">"<<std::endl;
fout<<"<img src=\""<<osgDB::getSimpleFileName(os.str())<<"\">"<<std::endl;
fout<<"</html>"<<std::endl;
}
else

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef EXPORTHTML_H

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include "PointsEventHandler.h"
@@ -55,6 +54,11 @@ bool PointsEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
return false;
}
void PointsEventHandler::accept(osgGA::GUIEventHandlerVisitor& v)
{
v.visit(*this);
}
void PointsEventHandler::getUsage(osg::ApplicationUsage& usage) const
{
usage.addKeyboardMouseBinding("+","Increase point size");

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef POINTSEVENTHANDLER
@@ -23,23 +22,25 @@ class PointsEventHandler : public osgGA::GUIEventHandler
{
public:
PointsEventHandler();
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);
virtual void accept(osgGA::GUIEventHandlerVisitor& v);
void getUsage(osg::ApplicationUsage& usage) const;
void setStateSet(osg::StateSet* stateset) { _stateset=stateset; }
osg::StateSet* getStateSet() { return _stateset.get(); }
const osg::StateSet* getStateSet() const { return _stateset.get(); }
void setPointSize(float psize);
float getPointSize() const;
void changePointSize(float delta);
void changePointAttenuation(float scale);
osg::ref_ptr<osg::StateSet> _stateset;

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include "ReadShowFile.h"
@@ -36,7 +35,7 @@ class AddVolumeEditingCallbackVisitor : public osg::NodeVisitor
public:
AddVolumeEditingCallbackVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
void apply(osg::Group& group)
{
osgVolume::VolumeTile* volumeTile = dynamic_cast<osgVolume::VolumeTile*>(&group);
@@ -52,7 +51,7 @@ public:
traverse(group);
}
}
};
bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, FileNameList& normalFiles)
@@ -63,7 +62,7 @@ bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, F
if (!arguments.isOption(pos))
{
std::string ext = osgDB::getFileExtension(arguments[pos]);
if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d"))
if (osgDB::equalCaseInsensitive(ext,"xml") || osgDB::equalCaseInsensitive(ext,"p3d"))
{
xmlFiles.push_back(arguments[pos]);
}
@@ -74,7 +73,7 @@ bool p3d::getFileNames(osg::ArgumentParser& arguments, FileNameList& xmlFiles, F
}
}
return (!xmlFiles.empty() || !normalFiles.empty());
}
}
bool p3d::readEnvVars(osg::ArgumentParser& arguments)
{
@@ -95,23 +94,23 @@ bool p3d::readEnvVars(osg::ArgumentParser& arguments)
{
osgDB::getDataFilePathList().push_front(path);
}
if (p3d::readEnvVars(file)) readVars = true;
}
}
}
}
return readVars;
}
bool p3d::readEnvVars(const std::string& fileName)
{
std::string ext = osgDB::getFileExtension(fileName);
if (!osgDB::equalCaseInsensitive(ext,"xml") &&
if (!osgDB::equalCaseInsensitive(ext,"xml") &&
!osgDB::equalCaseInsensitive(ext,"p3d")) return false;
osg::ref_ptr<osgDB::XmlNode> doc = new osgDB::XmlNode;
osgDB::XmlNode* root = 0;
@@ -147,7 +146,7 @@ bool p3d::readEnvVars(const std::string& fileName)
}
bool readVars = false;
for(osgDB::XmlNode::Children::iterator itr = root->children.begin();
itr != root->children.end();
++itr)
@@ -183,7 +182,7 @@ osgDB::Options* createOptions(const osgDB::ReaderWriter::Options* options)
osg::ref_ptr<osg::Node> p3d::readHoldingSlide(const std::string& filename)
{
std::string ext = osgDB::getFileExtension(filename);
if (!osgDB::equalCaseInsensitive(ext,"xml") &&
if (!osgDB::equalCaseInsensitive(ext,"xml") &&
!osgDB::equalCaseInsensitive(ext,"p3d")) return 0;
osg::ref_ptr<osgDB::ReaderWriter::Options> options = createOptions(0);
@@ -216,24 +215,24 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
std::string filename;
while (arguments.read("--image",filename))
{
osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get());
if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image));
osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get());
if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image.get()));
}
while (arguments.read("--movie",filename))
{
osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get());
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (imageStream)
osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get());
osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (image.valid())
{
imageStream->play();
nodeList.push_back(osg::createGeodeForImage(imageStream));
nodeList.push_back(osg::createGeodeForImage(imageStream.get()));
}
}
while (arguments.read("--dem",filename))
{
osg::ref_ptr<osg::HeightField> hf = readRefHeightFieldFile(filename.c_str(), local_options.get());
osg::HeightField* hf = readHeightFieldFile(filename.c_str(), local_options.get());
if (hf)
{
osg::Geode* geode = new osg::Geode;
@@ -248,25 +247,21 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
if (!arguments.isOption(pos))
{
// not an option so assume string is a filename.
osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFile( arguments[pos], local_options.get());
osg::Node *node = osgDB::readNodeFile( arguments[pos], local_options.get());
if(node)
{
if (node->getName().empty()) node->setName( arguments[pos] );
nodeList.push_back(node);
// make sure that this presentation isn't cached
osgDB::Registry::instance()->removeFromObjectCache( arguments[pos], local_options.get());
}
}
}
if (nodeList.empty())
{
return NULL;
}
osg::ref_ptr<osg::Node> root;
if (nodeList.size()==1)
@@ -275,7 +270,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
}
else // size >1
{
osg::Switch* sw = new osg::Switch;
for(NodeList::iterator itr=nodeList.begin();
itr!=nodeList.end();
@@ -284,7 +279,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
sw->addChild((*itr).get());
}
sw->setSingleChildOn(0);
sw->setEventCallback(new p3d::ShowEventHandler());
root = sw;
@@ -293,7 +288,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
if (root.valid())
{
osg::notify(osg::INFO)<<"Got node now adding callback"<<std::endl;
AddVolumeEditingCallbackVisitor avecv;
root->accept(avecv);
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef P3D_READFILE

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include <osgViewer/Viewer>
@@ -34,7 +33,7 @@ SDLIntegration::SDLIntegration()
atexit(SDL_Quit);
int numJoysticks = SDL_NumJoysticks();
if (_verbose)
{
std::cout<<"number of joysticks "<<numJoysticks<<std::endl;
@@ -43,9 +42,9 @@ SDLIntegration::SDLIntegration()
std::cout<<"Joystick name '"<<SDL_JoystickName(i)<<"'"<<std::endl;
}
}
_joystick = numJoysticks>0 ? SDL_JoystickOpen(0) : 0;
_numAxes = _joystick ? SDL_JoystickNumAxes(_joystick) : 0;
_numBalls = _joystick ? SDL_JoystickNumBalls(_joystick) : 0;
_numHats = _joystick ? SDL_JoystickNumHats(_joystick) : 0;
@@ -58,13 +57,13 @@ SDLIntegration::SDLIntegration()
std::cout<<"numHats = "<<_numHats<<std::endl;
std::cout<<"numButtons = "<<_numButtons<<std::endl;
}
addMouseButtonMapping(4, 1); // left
addMouseButtonMapping(5, 3); // right
addMouseButtonMapping(6, 2); // middle
addKeyMapping(10, ' '); // R2
addKeyMapping(0, '1'); // 1
addKeyMapping(1, '2'); // 2
addKeyMapping(2, '3'); // 3
@@ -89,7 +88,7 @@ void SDLIntegration::capture(ValueList& axisValues, ValueList& buttonValues) con
if (_joystick)
{
SDL_JoystickUpdate();
axisValues.resize(_numAxes);
for(int ai=0; ai<_numAxes; ++ai)
{
@@ -108,21 +107,21 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
{
if (_joystick)
{
ValueList newAxisValues;
ValueList newButtonValues;
capture(newAxisValues, newButtonValues);
unsigned int mouseXaxis = 0;
unsigned int mouseYaxis = 1;
float prev_mx = (float)_axisValues[mouseXaxis]/32767.0f;
float prev_my = -(float)_axisValues[mouseYaxis]/32767.0f;
float mx = (float)newAxisValues[mouseXaxis]/32767.0f;
float my = -(float)newAxisValues[mouseYaxis]/32767.0f;
osgGA::EventQueue* eq = viewer.getEventQueue();
double time = eq ? eq->getTime() : 0.0;
@@ -146,7 +145,7 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
}
}
}
for(int bi=0; bi<_numButtons; ++bi)
{
if (newButtonValues[bi]!=_buttonValues[bi])
@@ -172,11 +171,11 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
}
}
}
_axisValues.swap(newAxisValues);
_buttonValues.swap(newButtonValues);
}
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef SDLINTEGRATION
@@ -32,12 +31,12 @@ class SDLIntegration
typedef std::map<int, int> ButtonMap;
void update(osgViewer::Viewer& viewer);
void addMouseButtonMapping(int joystickButton, int mouseButton)
{
_mouseButtonMap[joystickButton] = mouseButton;
}
int getMouseButtonMapping(int joystickButton)
{
ButtonMap::const_iterator itr = _mouseButtonMap.find(joystickButton);
@@ -49,16 +48,16 @@ class SDLIntegration
{
_keyMap[joystickButton] = key;
}
int getKeyMapping(int joystickButton)
{
ButtonMap::const_iterator itr = _keyMap.find(joystickButton);
if (itr != _keyMap.end()) return itr->second;
else return -1;
}
protected:
void capture(ValueList& axisValues, ValueList& buttonValues) const;
SDL_Joystick* _joystick;
@@ -67,7 +66,7 @@ class SDLIntegration
int _numHats;
int _numButtons;
bool _verbose;
ValueList _axisValues;
ValueList _buttonValues;
ButtonMap _mouseButtonMap;

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include "ShowEventHandler.h"
@@ -29,13 +28,13 @@ bool ShowEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
case(osgGA::GUIEventAdapter::KEYUP):
{
osg::notify(osg::INFO)<<"ShowEventHandler KEYUP "<<(int)ea.getKey()<<std::endl;
if (ea.getKey()>=osgGA::GUIEventAdapter::KEY_F1 &&
if (ea.getKey()>=osgGA::GUIEventAdapter::KEY_F1 &&
ea.getKey()<=osgGA::GUIEventAdapter::KEY_F8)
{
unsigned int child = ea.getKey()-osgGA::GUIEventAdapter::KEY_F1;
osg::notify(osg::INFO)<<" Select "<<child<<std::endl;
osg::Switch* showSwitch = dynamic_cast<osg::Switch*>(object);
if (showSwitch)
if (showSwitch)
{
if (child<showSwitch->getNumChildren())
{
@@ -53,6 +52,12 @@ bool ShowEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
return false;
}
void ShowEventHandler::accept(osgGA::GUIEventHandlerVisitor& v)
{
v.visit(*this);
}
void ShowEventHandler::getUsage(osg::ApplicationUsage& /*usage*/) const
{
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef SHOWEVENTHANDLER
@@ -29,9 +28,11 @@ class ShowEventHandler : public osgGA::GUIEventHandler
ShowEventHandler();
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv);
virtual void accept(osgGA::GUIEventHandlerVisitor& v);
virtual void getUsage(osg::ApplicationUsage& usage) const;
};
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include <osgDB/FileNameUtils>
@@ -87,7 +86,7 @@ bool SpellChecker::isCorrect(const std::string& word) const
return true;
}
SpellChecker::WordList SpellChecker::suggest(const std::string& /*word*/) const
SpellChecker::WordList SpellChecker::suggest(const std::string& word) const
{
return WordList();
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#ifndef SPELLCHCKER_H

File diff suppressed because it is too large Load Diff

1
configure vendored Executable file
View File

@@ -0,0 +1 @@
cmake . -DCMAKE_BUILD_TYPE=Release $@

View File

@@ -1 +0,0 @@
ldconfig

View File

@@ -31,6 +31,7 @@ SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
@@ -39,7 +40,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -76,6 +76,7 @@ GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
@@ -137,6 +138,7 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"

View File

@@ -31,6 +31,7 @@ SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
@@ -39,7 +40,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -76,6 +76,7 @@ GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
@@ -99,16 +100,15 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \
@@ -151,6 +151,7 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"

View File

@@ -128,6 +128,13 @@ JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
# will output the detailed description near the top, like JavaDoc.
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.
@@ -169,25 +176,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING = no_extension=C++
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
@@ -583,6 +571,12 @@ HTML_FOOTER =
HTML_STYLESHEET =
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)

View File

@@ -21,6 +21,7 @@ SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
@@ -29,7 +30,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -66,6 +66,7 @@ GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
@@ -89,16 +90,15 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \
@@ -141,6 +141,7 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"

View File

@@ -11,12 +11,12 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
@@ -24,12 +24,11 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -37,6 +36,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -63,13 +63,14 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -79,27 +80,26 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgAnimation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgDB" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgFX" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgText" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgUI" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgUtil" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgViewer" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgVolume" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgWidget"
"${OpenSceneGraph_SOURCE_DIR}/include/osgWidget" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgQt" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgAnimation"
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \
*.cpp
@@ -107,13 +107,13 @@ RECURSIVE = YES
EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
@@ -131,16 +131,17 @@ VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = OpenSceneGraphReferenceDocs
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
@@ -149,14 +150,14 @@ GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../${CMAKE_PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION =
QHG_LOCATION =
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
@@ -171,8 +172,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
@@ -184,8 +185,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -198,6 +199,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -209,36 +212,37 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
@@ -252,7 +256,7 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH = "${DOXYGEN_DOT_PATH}"
DOTFILE_DIRS =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
@@ -260,6 +264,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -11,12 +11,12 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
@@ -24,12 +24,11 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -37,6 +36,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -63,13 +63,14 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -79,7 +80,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
@@ -91,13 +92,13 @@ RECURSIVE = YES
EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
@@ -115,16 +116,17 @@ VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = OpenThreadsReferenceDocs
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
@@ -133,14 +135,14 @@ GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION =
QHG_LOCATION =
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
@@ -155,8 +157,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
@@ -168,8 +170,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -182,6 +184,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -193,36 +197,37 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
@@ -235,8 +240,8 @@ CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
@@ -244,6 +249,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -4,14 +4,14 @@
SET(TARGET_DEFAULT_PREFIX "example_")
SET(TARGET_DEFAULT_LABEL_PREFIX "Examples")
SET(TARGET_COMMON_LIBRARIES
SET(TARGET_COMMON_LIBRARIES
OpenThreads
osg
osgDB
osg
osgDB
osgUtil
osgGA
osgViewer
osgText
osgViewer
osgText
)
IF(ANDROID)
@@ -20,15 +20,12 @@ ELSE(ANDROID)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgsimpleMDI)
ADD_SUBDIRECTORY(osg2cpp)
ADD_SUBDIRECTORY(osganalysis)
ADD_SUBDIRECTORY(osganimate)
ADD_SUBDIRECTORY(osgatomiccounter)
ADD_SUBDIRECTORY(osgautocapture)
ADD_SUBDIRECTORY(osgautotransform)
ADD_SUBDIRECTORY(osgbillboard)
ADD_SUBDIRECTORY(osgblenddrawbuffers)
ADD_SUBDIRECTORY(osgblendequation)
ADD_SUBDIRECTORY(osgcallback)
ADD_SUBDIRECTORY(osgcamera)
@@ -37,7 +34,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgcompositeviewer)
ADD_SUBDIRECTORY(osgcopy)
ADD_SUBDIRECTORY(osgcubemap)
ADD_SUBDIRECTORY(osgdeferred)
ADD_SUBDIRECTORY(osgdelaunay)
ADD_SUBDIRECTORY(osgcluster)
ADD_SUBDIRECTORY(osgdatabaserevisions)
ADD_SUBDIRECTORY(osgdepthpartition)
@@ -50,38 +47,33 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgfxbrowser)
ADD_SUBDIRECTORY(osgoutline)
ADD_SUBDIRECTORY(osggameoflife)
ADD_SUBDIRECTORY(osggeodemo)
ADD_SUBDIRECTORY(osggeometry)
ADD_SUBDIRECTORY(osggeometryshaders)
ADD_SUBDIRECTORY(osghangglide)
ADD_SUBDIRECTORY(osghud)
ADD_SUBDIRECTORY(osgimagesequence)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgintersection)
ADD_SUBDIRECTORY(osgkdtree)
ADD_SUBDIRECTORY(osgkeyboard)
ADD_SUBDIRECTORY(osgkeyboardmouse)
ADD_SUBDIRECTORY(osgkeystone)
ADD_SUBDIRECTORY(osglauncher)
ADD_SUBDIRECTORY(osglight)
ADD_SUBDIRECTORY(osglightpoint)
ADD_SUBDIRECTORY(osglogicop)
ADD_SUBDIRECTORY(osglogo)
ADD_SUBDIRECTORY(osggpucull)
ADD_SUBDIRECTORY(osggpx)
ADD_SUBDIRECTORY(osggraphicscost)
ADD_SUBDIRECTORY(osgmanipulator)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgmovie)
ADD_SUBDIRECTORY(osgmultiplemovies)
ADD_SUBDIRECTORY(osgmultiplerendertargets)
ADD_SUBDIRECTORY(osgmultitexture)
ADD_SUBDIRECTORY(osgmultitexturecontrol)
ADD_SUBDIRECTORY(osgmultitouch)
ADD_SUBDIRECTORY(osgmultiviewpaging)
ADD_SUBDIRECTORY(osgobjectcache)
ADD_SUBDIRECTORY(osgoccluder)
ADD_SUBDIRECTORY(osgocclusionquery)
ADD_SUBDIRECTORY(osgoit)
ADD_SUBDIRECTORY(osgoscdevice)
ADD_SUBDIRECTORY(osgpackeddepthstencil)
ADD_SUBDIRECTORY(osgpagedlod)
ADD_SUBDIRECTORY(osgparametric)
@@ -98,22 +90,17 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgprerendercubemap)
ADD_SUBDIRECTORY(osgreflect)
ADD_SUBDIRECTORY(osgrobot)
ADD_SUBDIRECTORY(osgSSBO)
ADD_SUBDIRECTORY(osgsampler)
ADD_SUBDIRECTORY(osgscalarbar)
ADD_SUBDIRECTORY(osgscribe)
ADD_SUBDIRECTORY(osgsequence)
ADD_SUBDIRECTORY(osgshaders)
ADD_SUBDIRECTORY(osgshaderpipeline)
ADD_SUBDIRECTORY(osgshadercomposition)
ADD_SUBDIRECTORY(osgshadergen)
ADD_SUBDIRECTORY(osgshadermultiviewport)
ADD_SUBDIRECTORY(osgshaderterrain)
# ADD_SUBDIRECTORY(osgshadercompositor)
ADD_SUBDIRECTORY(osgshadow)
ADD_SUBDIRECTORY(osgshape)
ADD_SUBDIRECTORY(osgsharedarray)
ADD_SUBDIRECTORY(osgsimpleshaders)
ADD_SUBDIRECTORY(osgsimplifier)
ADD_SUBDIRECTORY(osgsimulation)
ADD_SUBDIRECTORY(osgsidebyside)
@@ -125,17 +112,14 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgstereomatch)
ADD_SUBDIRECTORY(osgterrain)
ADD_SUBDIRECTORY(osgthreadedterrain)
ADD_SUBDIRECTORY(osgtransferfunction)
ADD_SUBDIRECTORY(osgtext)
ADD_SUBDIRECTORY(osgtext3D)
ADD_SUBDIRECTORY(osgtexture1D)
ADD_SUBDIRECTORY(osgtexture2D)
ADD_SUBDIRECTORY(osgtexture2DArray)
ADD_SUBDIRECTORY(osgtexture3D)
ADD_SUBDIRECTORY(osgtexturerectangle)
ADD_SUBDIRECTORY(osgtexturecompression)
ADD_SUBDIRECTORY(osgthirdpersonview)
ADD_SUBDIRECTORY(osgtransformfeedback)
ADD_SUBDIRECTORY(osguniformbuffer)
ADD_SUBDIRECTORY(osguserstats)
ADD_SUBDIRECTORY(osgvertexprogram)
@@ -168,9 +152,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgwidgettable)
ADD_SUBDIRECTORY(osgwidgetwindow)
ADD_SUBDIRECTORY(osguserdata)
# GL3/GL4 example
ADD_SUBDIRECTORY(osgsimplegl3)
ADD_SUBDIRECTORY(osgbindlesstext)
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
ADD_SUBDIRECTORY(osgunittests)
ADD_SUBDIRECTORY(osgmemorytest)
@@ -188,11 +170,13 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgphotoalbum)
ADD_SUBDIRECTORY(osgtessellate)
ADD_SUBDIRECTORY(osgtessellationshaders)
ADD_SUBDIRECTORY(osgcomputeshaders)
ADD_SUBDIRECTORY(osgpdf)
IF (GLUT_FOUND)
ADD_SUBDIRECTORY(osgviewerGLUT)
ENDIF(GLUT_FOUND)
IF (SDL_FOUND)
ADD_SUBDIRECTORY(osgviewerSDL)
ENDIF(SDL_FOUND)
@@ -205,21 +189,34 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgviewerFOX)
ENDIF(FOX_FOUND)
IF (wxWidgets_FOUND AND CMAKE_BUILD_TYPE)
IF (${CMAKE_BUILD_TYPE} STREQUAL "Release")
ADD_SUBDIRECTORY(osgviewerWX)
IF (wxWidgets_FOUND)
ADD_SUBDIRECTORY(osgviewerWX)
ENDIF(wxWidgets_FOUND)
IF (QT_FOUND AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
OPTION(BUILD_QT_EXAMPLES "Enable the build of the examples that depend on Qt" ON)
IF (BUILD_QT_EXAMPLES AND QT_QTOPENGL_LIBRARY)
ADD_SUBDIRECTORY(osgviewerQt)
ADD_SUBDIRECTORY(osgqfont)
ENDIF()
IF (BUILD_QT_EXAMPLES AND QT4_FOUND AND QT_QTWEBKIT_FOUND)
ADD_SUBDIRECTORY(osgQtWidgets)
ADD_SUBDIRECTORY(osgQtBrowser)
ENDIF()
ENDIF()
IF (FLTK_FOUND AND FLTK_GL_LIBRARY)
IF (FLTK_FOUND)
ADD_SUBDIRECTORY(osgviewerFLTK)
ENDIF()
ENDIF(FLTK_FOUND)
IF (WIN32)
OPTION(BUILD_MFC_EXAMPLE "Enable the build of the MFC Example" OFF)
IF (BUILD_MFC_EXAMPLE)
IF (BUILD_MFC_EXAMPLE)
ADD_SUBDIRECTORY(osgviewerMFC)
ENDIF(BUILD_MFC_EXAMPLE)
@@ -243,12 +240,15 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
#needed on win32 or the linker get confused by _declspec declarations
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
IF(OSG_BUILD_PLATFORM_IPHONE)
ADD_SUBDIRECTORY(osgviewerIPhone)
ELSE()
ADD_SUBDIRECTORY(osgstaticviewer)
ENDIF()
ADD_SUBDIRECTORY(osgstaticviewer)
# IPHONE_PORT@tom
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
ADD_SUBDIRECTORY(osgviewerIPhone)
ENDIF()
# IPHONE_PORT@tom
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF(ANDROID)

View File

@@ -7,7 +7,7 @@
#include <iostream>
// Search in str for all occurrences of spat and replace them with rpat.
// Search in str for all occurences of spat and replace them with rpat.
void searchAndReplace(std::string& str, const std::string& spat, const std::string& rpat)
{
std::string::size_type pos = 0;
@@ -30,13 +30,13 @@ void writeShader(osg::Shader* shader, const std::string& cppFileName, const std:
searchAndReplace(shaderSource, "\r\n", "\n");
searchAndReplace(shaderSource, "\r", "\n");
searchAndReplace(shaderSource, "\"", "\\\"");
std::string variableString = std::string("char ")+variableName+std::string("[] = ");
std::string::size_type startOfLine = 0;
std::string::size_type endOfLine = shaderSource.find_first_of('\n', startOfLine);
if (endOfLine==std::string::npos)
if (endOfLine==std::string::npos)
{
fout<<variableString<<shaderSource<<"\\n\";"<<std::endl;
}
@@ -63,29 +63,25 @@ int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting glsl shader files into char arrays that can be compiled into applications.");
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting between various input and output databases formats.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
arguments.getApplicationUsage()->addCommandLineOption("--write-to-source-file-directory","Use the path to the source filename as the directory to write to.");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
{
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
bool useSamePathAsSourceFile = false;
if (arguments.read("--write-to-source-file-directory")) useSamePathAsSourceFile = true;
std::string filename;
if (arguments.read("--shader",filename))
{
osg::ref_ptr<osg::Shader> shader = osgDB::readRefShaderFile(filename);
osg::ref_ptr<osg::Shader> shader = osgDB::readShaderFile(filename);
if (shader.valid())
{
std::string name = osgDB::getStrippedName(filename);
@@ -98,11 +94,9 @@ int main( int argc, char **argv )
name[pos] = '_';
pos = name.find_first_of(invalidCharacters);
}
std::string ext = osgDB::getFileExtension(filename);
std::string cppFileName = name + "_" + ext + ".cpp";
if (useSamePathAsSourceFile) cppFileName = osgDB::concatPaths(path, cppFileName);
std::string cppFileName = osgDB::concatPaths(path, name + "_" + ext + ".cpp");
std::string variableName = name + "_" + ext;
writeShader(shader.get(), cppFileName, variableName);
@@ -113,7 +107,7 @@ int main( int argc, char **argv )
std::cout<<"Error: could not find file '"<<filename<<"'"<<std::endl;
return 1;
}
}
std::cout<<"No appropriate command line options used."<<std::endl;

View File

@@ -5,7 +5,7 @@
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requirements (1.1) -->
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requierements (1.1) -->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/osg">

View File

@@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){
newModel = _vModelsToLoad[i];
osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(newModel.filename);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(newModel.filename);
if (loadedModel == 0) {
osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl;
} else {

View File

@@ -75,7 +75,7 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_setClearColor(JNIEnv
}
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){
//Import Strings from JNI
const char *nativeAddress = env->GetStringUTFChars(address, JNI_FALSE);
const char *nativeAddress = env->GetStringUTFChars(address, false);
mainApp.loadObject(std::string(nativeAddress));
@@ -84,8 +84,8 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv *
}
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){
//Import Strings from JNI
const char *nativeAddress = env->GetStringUTFChars(address,JNI_FALSE);
const char *nativeName = env->GetStringUTFChars(name, JNI_FALSE);
const char *nativeAddress = env->GetStringUTFChars(address, false);
const char *nativeName = env->GetStringUTFChars(name, false);
mainApp.loadObject(std::string(nativeName),std::string(nativeAddress));

View File

@@ -5,7 +5,7 @@
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requirements (2.0) -->
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requierements (2.0) -->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/osg">

View File

@@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){
newModel = _vModelsToLoad[i];
osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(newModel.filename);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(newModel.filename);
if (loadedModel == 0) {
osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl;
} else {
@@ -103,9 +103,7 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
_viewer = new osgViewer::Viewer();
osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
_viewer->getEventQueue()->setGraphicsContext(window);
_viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext();
_viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
_root = new osg::Group();

View File

@@ -75,7 +75,7 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_setClearColor(JNIEnv
}
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){
//Import Strings from JNI
const char *nativeAddress = env->GetStringUTFChars(address, JNI_FALSE);
const char *nativeAddress = env->GetStringUTFChars(address, false);
mainApp.loadObject(std::string(nativeAddress));
@@ -84,8 +84,8 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv *
}
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){
//Import Strings from JNI
const char *nativeAddress = env->GetStringUTFChars(address,JNI_FALSE);
const char *nativeName = env->GetStringUTFChars(name, JNI_FALSE);
const char *nativeAddress = env->GetStringUTFChars(address, false);
const char *nativeName = env->GetStringUTFChars(name, false);
mainApp.loadObject(std::string(nativeName),std::string(nativeAddress));

View File

@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 2.6)
SET(PROJECT_NAME osgCMakeExample)
PROJECT(${PROJECT_NAME})
FIND_PACKAGE(OpenThreads)
FIND_PACKAGE(osg)
FIND_PACKAGE(osgDB)
FIND_PACKAGE(osgUtil)
FIND_PACKAGE(osgGA)
FIND_PACKAGE(osgViewer)
SET(SOURCES
main.cpp
)
INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR} ${OSG_INCLUDE_DIR})
LINK_DIRECTORIES(${OSG_LIB_DIR})
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${OSG_LIBRARIES} ${OSGVIEWER_LIBRARIES} ${OSGUTIL_LIBRARIES} ${OSGDB_LIBRARIES} ${OSGGA_LIBRARIES} ${OPENTHREADS_LIBRARIES})

View File

@@ -1,183 +0,0 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/StateSetManipulator>
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TerrainManipulator>
#include <osgGA/SphericalManipulator>
#include <osgGA/Device>
#include <iostream>
int main(int argc, char** argv)
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
osgViewer::Viewer viewer(arguments);
unsigned int helpType = 0;
if ((helpType = arguments.readHelpType()))
{
arguments.getApplicationUsage()->write(std::cout, helpType);
return 1;
}
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
}
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
std::string device;
while(arguments.read("--device", device))
{
osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device);
if (dev.valid())
{
viewer.addDevice(dev);
}
}
// set up the camera manipulators.
{
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
keyswitchManipulator->addMatrixManipulator( '5', "Orbit", new osgGA::OrbitManipulator() );
keyswitchManipulator->addMatrixManipulator( '6', "FirstPerson", new osgGA::FirstPersonManipulator() );
keyswitchManipulator->addMatrixManipulator( '7', "Spherical", new osgGA::SphericalManipulator() );
std::string pathfile;
double animationSpeed = 1.0;
while(arguments.read("--speed",animationSpeed) ) {}
char keyForAnimationPath = '8';
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm && !apm->getAnimationPath()->empty())
{
apm->setTimeScale(animationSpeed);
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
keyswitchManipulator->selectMatrixManipulator(num);
++keyForAnimationPath;
}
}
viewer.setCameraManipulator( keyswitchManipulator.get() );
}
// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
// add the thread model handler
viewer.addEventHandler(new osgViewer::ThreadingHandler);
// add the window size toggle handler
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
// add the help handler
viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));
// add the record camera path handler
viewer.addEventHandler(new osgViewer::RecordCameraPathHandler);
// add the LOD Scale handler
viewer.addEventHandler(new osgViewer::LODScaleHandler);
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
// optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel);
viewer.setSceneData(loadedModel);
viewer.realize();
return viewer.run();
}

View File

@@ -0,0 +1,16 @@
SET(TARGET_SRC
osgQtBrowser.cpp
)
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -pedantic flag as it barfs on Qt headers
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
#### end var setup ###
SETUP_EXAMPLE(osgQtBrowser)

View File

@@ -0,0 +1,139 @@
/* OpenSceneGraph example, osgcompositeviewer.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <osg/Notify>
#include <osg/io_utils>
#include <osg/ArgumentParser>
#include <osgDB/WriteFile>
#include <osgGA/TrackballManipulator>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgWidget/Browser>
#include <QtWebKit/QWebSettings>
#include <QtWebKit/QtWebKit>
#include <QtGui/QGraphicsScene>
#include <QtGui/QGraphicsView>
#include <QtGui/QApplication>
#include <QtGui/QPainter>
#include <QtGui/QtEvents>
#include <osgQt/QGraphicsViewAdapter>
#include <osgQt/QWebViewImage>
// Thread that runs the viewer's frame loop as we can't run Qt in the background...
class ViewerFrameThread : public OpenThreads::Thread
{
public:
ViewerFrameThread(osgViewer::ViewerBase* viewerBase, bool doQApplicationExit):
_viewerBase(viewerBase),
_doQApplicationExit(doQApplicationExit) {}
~ViewerFrameThread()
{
cancel();
while(isRunning())
{
OpenThreads::Thread::YieldCurrentThread();
}
}
int cancel()
{
_viewerBase->setDone(true);
return 0;
}
void run()
{
int result = _viewerBase->run();
if (_doQApplicationExit) QApplication::exit(result);
}
osg::ref_ptr<osgViewer::ViewerBase> _viewerBase;
bool _doQApplicationExit;
};
int main(int argc, char **argv)
{
// Qt requires that we construct the global QApplication before creating any widgets.
QApplication app(argc, argv);
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
bool useFrameLoopThread = false;
if (arguments.read("--no-frame-thread")) useFrameLoopThread = false;
if (arguments.read("--frame-thread")) useFrameLoopThread = true;
osg::ref_ptr<osgQt::QWebViewImage> image = new osgQt::QWebViewImage;
if (arguments.argc()>1) image->navigateTo((arguments[1]));
else image->navigateTo("http://www.youtube.com/");
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
osg::Vec3(1.0f,0.0f,0.0f),
osg::Vec3(0.0f,0.0f,1.0f),
osg::Vec4(1.0f,1.0f,1.0f,1.0f),
osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);
osg::ref_ptr<osgWidget::Browser> browser = new osgWidget::Browser;
browser->assign(image.get(), hints);
// image->focusBrowser(true);
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer(arguments);
viewer->setSceneData(browser.get());
viewer->setCameraManipulator(new osgGA::TrackballManipulator());
viewer->addEventHandler(new osgViewer::StatsHandler);
viewer->addEventHandler(new osgViewer::WindowSizeHandler);
if (useFrameLoopThread)
{
// create a thread to run the viewer's frame loop
ViewerFrameThread viewerThread(viewer.get(), true);
viewerThread.startThread();
// now start the standard Qt event loop, then exists when the viewerThead sends the QApplication::exit() signal.
return QApplication::exec();
}
else
{
// run the frame loop, interleaving Qt and the main OSG frame loop
while(!viewer->done())
{
// process Qt events - this handles both events and paints the browser image
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
viewer->frame();
}
return 0;
}
}

View File

@@ -0,0 +1,16 @@
SET(TARGET_SRC
osgQtWidgets.cpp
)
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -pedantic flag as it barfs on Qt headers
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
#### end var setup ###
SETUP_EXAMPLE(osgQtWidgets)

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
SET(TARGET_SRC osgSSBO.cpp )
SETUP_EXAMPLE(osgSSBO)

Some files were not shown because too many files have changed in this diff Show More