From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them.
Most notable the __hpux define stuff. The __hpux__ variant seems to be not defined which resulted in a compile error at this time. Consequently I have replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg plugins are found and loaded correctly ... The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake generator target behave like the ide one. Showed up because I started to do scripted builds with nmake instead of devenv... The rest is the usual bunch of stuff that just happens during normal coding ..."
This commit is contained in:
parent
259daac9a9
commit
b7cabac990
@ -530,9 +530,9 @@ ENDIF(MSVC AND NOT MSVC_IDE)
|
|||||||
#SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME})
|
#SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME})
|
||||||
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
|
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
|
||||||
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
|
MAKE_DIRECTORY(${OUTPUT_LIBDIR})
|
||||||
IF(NOT MSVC)
|
IF(NOT MSVC OR MSVC_IDE)
|
||||||
MAKE_DIRECTORY(${OUTPUT_LIBDIR}/${OSG_PLUGINS})
|
MAKE_DIRECTORY(${OUTPUT_LIBDIR}/${OSG_PLUGINS})
|
||||||
ENDIF(NOT MSVC)
|
ENDIF(NOT MSVC OR MSVC_IDE)
|
||||||
|
|
||||||
# On CMake 2.4.x use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH and later
|
# On CMake 2.4.x use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH and later
|
||||||
# we work around the DLL placement by use of the PREFIX target property hack
|
# we work around the DLL placement by use of the PREFIX target property hack
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#elif defined (WIN32)
|
#elif defined (WIN32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#elif defined (__hpux__)
|
#elif defined (__hpux)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#error Teach me how to build on this system
|
#error Teach me how to build on this system
|
||||||
|
@ -70,7 +70,9 @@ QGraphicsViewAdapter::QGraphicsViewAdapter(osg::Image* image, QWidget* widget):
|
|||||||
_graphicsView = new QGraphicsView;
|
_graphicsView = new QGraphicsView;
|
||||||
_graphicsScene->addWidget(widget);
|
_graphicsScene->addWidget(widget);
|
||||||
_graphicsView->setScene(_graphicsScene);
|
_graphicsView->setScene(_graphicsScene);
|
||||||
|
#if (QT_VERSION_CHECK(4, 5, 0) <= QT_VERSION)
|
||||||
_graphicsScene->setStickyFocus(true);
|
_graphicsScene->setStickyFocus(true);
|
||||||
|
#endif
|
||||||
_graphicsView->viewport()->setParent(0);
|
_graphicsView->viewport()->setParent(0);
|
||||||
|
|
||||||
int width = _graphicsScene->width();
|
int width = _graphicsScene->width();
|
||||||
@ -455,4 +457,4 @@ void QGraphicsViewAdapter::assignImage(unsigned int i)
|
|||||||
GL_RGBA,GL_UNSIGNED_BYTE,
|
GL_RGBA,GL_UNSIGNED_BYTE,
|
||||||
data,
|
data,
|
||||||
osg::Image::NO_DELETE, 1);
|
osg::Image::NO_DELETE, 1);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SET(TARGET_SRC osgautocapture.cpp )
|
SET(TARGET_SRC osgautocapture.cpp )
|
||||||
|
|
||||||
|
SET(TARGET_ADDED_LIBRARIES osgTerrain )
|
||||||
#### end var setup ###
|
#### end var setup ###
|
||||||
SETUP_EXAMPLE(osgautocapture)
|
SETUP_EXAMPLE(osgautocapture)
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
#elif defined (WIN32)
|
#elif defined (WIN32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#elif defined (__hpux__)
|
#elif defined (__hpux)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#error Teach me how to build on this system
|
#error Teach me how to build on this system
|
||||||
|
@ -50,11 +50,8 @@ std::string createLibraryNameForWrapper(const std::string& ext)
|
|||||||
#endif
|
#endif
|
||||||
#elif macintosh
|
#elif macintosh
|
||||||
return "osgwrapper_"+ext;
|
return "osgwrapper_"+ext;
|
||||||
#elif defined(__hpux__)
|
|
||||||
// why don't we use PLUGIN_EXT from the makefiles here?
|
|
||||||
return "osgwrapper_"+ext+".sl";
|
|
||||||
#else
|
#else
|
||||||
return "osgwrapper_"+ext+".so";
|
return "osgwrapper_"+ext+ ADDQUOTES(OSG_PLUGIN_EXTENSION);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,10 @@
|
|||||||
inline float atan2f(float value1, float value2) { return static_cast<float>(atan2(value1,value2)); }
|
inline float atan2f(float value1, float value2) { return static_cast<float>(atan2(value1,value2)); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef fmodf
|
||||||
|
inline float fmodf(float value1, float value2) { return static_cast<float>(fmod(value1,value2)); }
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef tanf
|
#ifndef tanf
|
||||||
inline float tanf(float value) { return static_cast<float>(tan(value)); }
|
inline float tanf(float value) { return static_cast<float>(tan(value)); }
|
||||||
#endif
|
#endif
|
||||||
@ -199,7 +203,7 @@ inline double RadiansToDegrees(double angle) { return angle*180.0/PI; }
|
|||||||
inline float round(float v) { return v>=0.0f?floorf(v+0.5f):ceilf(v-0.5f); }
|
inline float round(float v) { return v>=0.0f?floorf(v+0.5f):ceilf(v-0.5f); }
|
||||||
inline double round(double v) { return v>=0.0?floor(v+0.5):ceil(v-0.5); }
|
inline double round(double v) { return v>=0.0?floor(v+0.5):ceil(v-0.5); }
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__)
|
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__)
|
||||||
inline bool isNaN(float v) { return _isnan(v)!=0; }
|
inline bool isNaN(float v) { return _isnan(v)!=0; }
|
||||||
inline bool isNaN(double v) { return _isnan(v)!=0; }
|
inline bool isNaN(double v) { return _isnan(v)!=0; }
|
||||||
#else
|
#else
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <osgPresentation/Export>
|
#include <osgPresentation/Export>
|
||||||
|
|
||||||
|
#include <iosfwd>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#else // all other unix
|
#else // all other unix
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef __hpux__
|
#ifdef __hpux
|
||||||
// Although HP-UX has dlopen() it is broken! We therefore need to stick
|
// Although HP-UX has dlopen() it is broken! We therefore need to stick
|
||||||
// to shl_load()/shl_unload()/shl_findsym()
|
// to shl_load()/shl_unload()/shl_findsym()
|
||||||
#include <dl.h>
|
#include <dl.h>
|
||||||
@ -63,7 +63,7 @@ DynamicLibrary::~DynamicLibrary()
|
|||||||
FreeLibrary((HMODULE)_handle);
|
FreeLibrary((HMODULE)_handle);
|
||||||
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
|
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
|
||||||
NSUnLinkModule(static_cast<NSModule>(_handle), FALSE);
|
NSUnLinkModule(static_cast<NSModule>(_handle), FALSE);
|
||||||
#elif defined(__hpux__)
|
#elif defined(__hpux)
|
||||||
// fortunately, shl_t is a pointer
|
// fortunately, shl_t is a pointer
|
||||||
shl_unload (static_cast<shl_t>(_handle));
|
shl_unload (static_cast<shl_t>(_handle));
|
||||||
#else // other unix
|
#else // other unix
|
||||||
@ -103,7 +103,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
|
|||||||
handle = NSLinkModule(image, libraryName.c_str(), TRUE);
|
handle = NSLinkModule(image, libraryName.c_str(), TRUE);
|
||||||
NSDestroyObjectFileImage(image);
|
NSDestroyObjectFileImage(image);
|
||||||
}
|
}
|
||||||
#elif defined(__hpux__)
|
#elif defined(__hpux)
|
||||||
// BIND_FIRST is neccessary for some reason
|
// BIND_FIRST is neccessary for some reason
|
||||||
handle = shl_load ( libraryName.c_str(), BIND_DEFERRED|BIND_FIRST|BIND_VERBOSE, 0);
|
handle = shl_load ( libraryName.c_str(), BIND_DEFERRED|BIND_FIRST|BIND_VERBOSE, 0);
|
||||||
return handle;
|
return handle;
|
||||||
@ -146,7 +146,7 @@ DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& p
|
|||||||
temp += procName; // Mac OS X prepends an underscore on function names
|
temp += procName; // Mac OS X prepends an underscore on function names
|
||||||
symbol = NSLookupSymbolInModule(static_cast<NSModule>(_handle), temp.c_str());
|
symbol = NSLookupSymbolInModule(static_cast<NSModule>(_handle), temp.c_str());
|
||||||
return NSAddressOfSymbol(symbol);
|
return NSAddressOfSymbol(symbol);
|
||||||
#elif defined(__hpux__)
|
#elif defined(__hpux)
|
||||||
void* result = NULL;
|
void* result = NULL;
|
||||||
if (shl_findsym (reinterpret_cast<shl_t*>(&_handle), procName.c_str(), TYPE_PROCEDURE, result) == 0)
|
if (shl_findsym (reinterpret_cast<shl_t*>(&_handle), procName.c_str(), TYPE_PROCEDURE, result) == 0)
|
||||||
{
|
{
|
||||||
|
@ -718,14 +718,11 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext)
|
|||||||
#else
|
#else
|
||||||
return prepend+"osgdb_"+lowercase_ext;
|
return prepend+"osgdb_"+lowercase_ext;
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__hpux__)
|
|
||||||
// why don't we use PLUGIN_EXT from the makefiles here?
|
|
||||||
return prepend+"osgdb_"+lowercase_ext+".sl";
|
|
||||||
#else
|
#else
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
return prepend+"osgdb_"+lowercase_ext+ OSG_DEBUG_POSTFIX_WITH_QUOTES + ".so";
|
return prepend+"osgdb_"+lowercase_ext+ OSG_DEBUG_POSTFIX_WITH_QUOTES + ADDQUOTES(OSG_PLUGIN_EXTENSION);
|
||||||
#else
|
#else
|
||||||
return prepend+"osgdb_"+lowercase_ext+".so";
|
return prepend+"osgdb_"+lowercase_ext+ADDQUOTES(OSG_PLUGIN_EXTENSION);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -749,14 +746,11 @@ std::string Registry::createLibraryNameForNodeKit(const std::string& name)
|
|||||||
#else
|
#else
|
||||||
return name;
|
return name;
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__hpux__)
|
|
||||||
// why don't we use PLUGIN_EXT from the makefiles here?
|
|
||||||
return "lib"+name+".sl";
|
|
||||||
#else
|
#else
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
return "lib"+name+OSG_DEBUG_POSTFIX_WITH_QUOTES +".so";
|
return "lib"+name+OSG_DEBUG_POSTFIX_WITH_QUOTES + ADDQUOTES(OSG_PLUGIN_EXTENSION);
|
||||||
#else
|
#else
|
||||||
return "lib"+name+".so";
|
return "lib"+name+ADDQUOTES(OSG_PLUGIN_EXTENSION);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public:
|
|||||||
int findColor(unsigned int rgb)
|
int findColor(unsigned int rgb)
|
||||||
{
|
{
|
||||||
int aci = 255;
|
int aci = 255;
|
||||||
itr = _indexColors.find(rgb);
|
ColorMap::const_iterator itr = _indexColors.find(rgb);
|
||||||
if (itr != _indexColors.end() ) {
|
if (itr != _indexColors.end() ) {
|
||||||
aci = itr->second;
|
aci = itr->second;
|
||||||
} else {
|
} else {
|
||||||
@ -156,11 +156,9 @@ protected:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
std::map<const unsigned int, unsigned char> _indexColors; // maps RGB to autocad index colour
|
typedef std::map<unsigned int, unsigned char> ColorMap;
|
||||||
std::map<const unsigned int, unsigned char> _hueColors; // maps hue angle to autocad index colour
|
ColorMap _indexColors; // maps RGB to autocad index colour
|
||||||
|
ColorMap _hueColors; // maps hue angle to autocad index colour
|
||||||
typedef std::pair <const unsigned int, unsigned char> ColorPair;
|
|
||||||
std::map<const unsigned int, unsigned char>::iterator itr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DXFWriterNodeVisitor: public osg::NodeVisitor {
|
class DXFWriterNodeVisitor: public osg::NodeVisitor {
|
||||||
|
@ -204,7 +204,7 @@ void LightPointNode::traverse(osg::NodeVisitor& nv)
|
|||||||
// as this will be our special light point drawable.
|
// as this will be our special light point drawable.
|
||||||
osgUtil::StateGraph::LeafList::iterator litr;
|
osgUtil::StateGraph::LeafList::iterator litr;
|
||||||
for(litr = rg->_leaves.begin();
|
for(litr = rg->_leaves.begin();
|
||||||
litr != rg->_leaves.end() && (*litr)->_drawable!=drawable;
|
litr != rg->_leaves.end() && (*litr)->_drawable.get()!=drawable;
|
||||||
++litr)
|
++litr)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ osg::StateSet *ShaderGenCache::getOrCreateStateSet(unsigned int stateMask)
|
|||||||
if (it == _stateSetMap.end())
|
if (it == _stateSetMap.end())
|
||||||
{
|
{
|
||||||
osg::StateSet *stateSet = createStateSet(stateMask);
|
osg::StateSet *stateSet = createStateSet(stateMask);
|
||||||
_stateSetMap.insert(it, std::make_pair(stateMask, stateSet));
|
_stateSetMap.insert(it, StateSetMap::value_type(stateMask, stateSet));
|
||||||
return stateSet;
|
return stateSet;
|
||||||
}
|
}
|
||||||
return it->second.get();
|
return it->second.get();
|
||||||
|
Loading…
Reference in New Issue
Block a user