On Wed, 2011-11-09 at 17:56 +0100, Frederic Bouvier wrote:
> > > In Ubuntu linux, because I do NOT have OSG installed in
> > > any 'standard' place, in my makefg script, I do -
> > > export CXXFLAGS="-DNO_OPENSCENEGRAPH_INTERFACE=1"
> > > export CFLAGS="-DNO_OPENSCENEGRAPH_INTERFACE=1"
> > > to get terragear-cs to cmake build...
> > > 
> > > Maybe the CFLAGS is not needed. I did try adding -
> > > -D CMAKE_CXX_FLAGS:STRING="-DNO_OPENSCENEGRAPH_INTERFACE=1"
> > > but could NOT get that working... it was not passed to
> > > the compiler...
> > 
> > The 'best' fix will be to set this define in the root CMakeList for
> > TerraGear - I'll do this 'soon' if no one beats me to it.
> 
> I already did that, but for MSVC only. I also had to add -DNO_TIMER
> 
> -Fred
> 

Hi Fred, James,

Well, I think the -DNO_OPENSCENEGRAPH_INTERFACE=1 
needs to be applied to ALL ports, since terragear-cs 
should have no need for OpenSceneGraph dependence, 
IN ANY MACHINE...

It seems -DNO_TIMER is due solely to a file 
as part of - 
 src/Lib/TriangleJRS/triangle.c
for systems that do NOT have the function 
'gettimeofday()', and that is just native Windows, 
no?

And maybe mingw? Or cygwin? - do not know...

In my previous TG Windows build I added -
#define NO_TIMER
#define TRILIBRARY
to a hand crafted config.h for MSVC...
and added -
#include config.h
to triangle.c...

But now that cmake generates a 'config.h' in 
ALL platforms, then perhaps it could be added 
to that rather than as yet ANOTHER compiler 
switch...

Or perhaps dealt with like TRILIBRARY, in
 src/Lib/TriangleJRS/CMakeLists.txt
set_target_properties(TriangleJRS PROPERTIES
        COMPILE_DEFINITIONS TRILIBRARY )

Although, really, it would NOT be a big job to add 
a gettimeofday() service, either using the native 
 QueryPerformanceCounter(&li) 
or even _ftime(), for the Windows port...

That could be as simple as -

#ifdef _MSC_VER
#include <sys\timeb.h>
#ifndef timeval /* is in Ws2_32.h */
struct timeval {
    long tv_sec;
    long tv_usec;
};
#endif /* timeval */
#ifndef timezone
struct timezone {
  int tz_minuteswest;
  int tz_dsttime;
};
#endif /* timezone */
int gettimeofday(struct timeval *tp, void *tzp)
{
    struct _timeb timebuffer;
    _ftime(&timebuffer);
    tp->tv_sec = timebuffer.time;
    tp->tv_usec = timebuffer.millitm * 1000;
    return 0;
}
#endif /* _MSC_VER */

Just tested this code in Windows, and it compiles 
fine, making no need to define NO_TIMER for 
Windows ;=))

Had to change one other line -
#ifndef NO_TIMER
to
#if !defined(NO_TIMER) && !defined(_MSC_VER)
#include <sys/time.h>
#endif /* NO_TIMER */

HTH.

Regards,
Geoff.




------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to