Re: [osg-users] Initial cut at CMake support + branch of osgEphemeris

2009-04-20 Thread Robert Osfield
HI Philip + Mattias,

On Thu, Apr 16, 2009 at 10:38 PM, Mattias Helsing wrote:

> Hi Robert,
>
> Philip was right on track and attached is the proof.


Cool, it works fine for me under Linux, fix now merged and submitted to
svn.


> I tried to build it on WinXP some days ago and succeeded with a few
> tweaks to the cmake files. Not sure if you are interested or where you
> are going with osgEphemeris in svn but will submit the changes and let
> you decide.
>

Getting osgEphemeris to compile easily against up to date versions of the
OSG is my immediate aim.  Thanks to your fix this now works :-)

Plans after this aren't too specific.  I would like to see the OSG support
an ephemeris model out of the box, but one that seamlessly handles whole
earth databases with movement near to the gound to outside the atmosphere.
osgEphemeris doesn't have this capability, so it'd either have to be added
to it, or for a new NodeKit with this capability to be written.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Initial cut at CMake support + branch of osgEphemeris

2009-04-16 Thread Mattias Helsing
Hi Robert,

Philip was right on track and attached is the proof.

I tried to build it on WinXP some days ago and succeeded with a few
tweaks to the cmake files. Not sure if you are interested or where you
are going with osgEphemeris in svn but will submit the changes and let
you decide.

cheers
Mattias

On Tue, Apr 14, 2009 at 2:09 PM, Philip Lowman  wrote:
> On Fri, Apr 10, 2009 at 11:33 AM, Robert Osfield 
> wrote:
>>
>> Which goes pretty sweetly till it tries to link the plugin.  These are the
>> errors I get:
>>
>> [ 86%] Building CXX object
>> src/osgEphemeris/CMakeFiles/osgEphemeris.dir/StarField.o
>> [ 93%] Building CXX object
>> src/osgEphemeris/CMakeFiles/osgEphemeris.dir/sun_image.o
>> Linking CXX shared library ../../lib/libosgEphemeris.so
>> [ 93%] Built target osgEphemeris
>> Scanning dependencies of target osgdb_osgephemeris
>> [100%] Building CXX object
>> src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/IO_EphemerisModel.o
>> Linking CXX shared module /osgPlugins-2.9.2/osgdb_osgephemeris.so
>> /usr/bin/ld: cannot open output file
>> /osgPlugins-2.9.2/osgdb_osgephemeris.so: No such file or directory
>> collect2: ld returned 1 exit status
>> make[2]: *** [/osgPlugins-2.9.2/osgdb_osgephemeris.so] Error 1
>> make[1]: ***
>> [src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/all] Error 2
>
> Hmm, server appears down for me so I can't have a look at this right now.
> I'm guessing that the problem has something to do with setting the PREFIX
> target property which I think is what OSG uses to force the plugins into an
> osgPlugins-x.y.z folder?
>
> Could you add the following after the declaration of
> add_library(osgephemeris MODULE...)
>
> message("CMAKE_LIBRARY_PATH = ${CMAKE_LIBRARY_PATH}")
> message("CMAKE_LIBRARY_OUTPUT_DIRECTORY =
> ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
> get_target_properties(the_prefix osgephemeris PREFIX)
> message("the prefix is = ${the_prefix}")
>
> --
> Philip Lowman
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)

IF(WIN32)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
ELSE()
IF(APPLE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
ELSE()
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
ENDIF()
ENDIF()

if(COMMAND cmake_policy)
# Works around warnings libraries linked against that don't
# have absolute paths (e.g. -lpthreads)
cmake_policy(SET CMP0003 NEW)

# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements.
cmake_policy(SET CMP0005 NEW)

# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path 
libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and 
Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND 
${CMAKE_PATCH_VERSION} GREATER 0)
cmake_policy(SET CMP0008 OLD)
endif()
endif()

PROJECT(OSGEPHEMERIS)

SET(OSGEPHEMERIS_MAJOR_VERSION 0)
SET(OSGEPHEMERIS_MINOR_VERSION 9)
SET(OSGEPHEMERIS_PATCH_VERSION 0)
SET(OSGEPHEMERIS_SOVERSION 0)

# set to 0 when not a release candidate, non zero means that any generated 
# svn tags will be treated as release candidates of given number
SET(OSGEPHEMERIS_RELEASE_CANDIDATE 0)

# We have some custom .cmake scripts not in the official distribution.
# Maybe this can be used override existing behavior if needed?
SET(CMAKE_MODULE_PATH 
"${OSGEPHEMERIS_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")

FIND_PACKAGE(OSG)

SET(OSGEPHEMERIS_VERSION 
${OSGEPHEMERIS_MAJOR_VERSION}.${OSGEPHEMERIS_MINOR_VERSION}.${OSGEPHEMERIS_PATCH_VERSION})

SET(OSGEPHEMERIS_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION})

SET(OSGEPHEMERIS_PLUGIN_PREFIX "") 

IF (CYGWIN)
SET(OSGEPHEMERIS_PLUGIN_PREFIX "cygwin_")
ENDIF()

IF(MINGW)
SET(OSGEPHEMERIS_PLUGIN_PREFIX "mingw_")
ENDIF()

# We want to build SONAMES shared librariess
SET(OSGEPHEMERIS_SONAMES TRUE)



# Okay, here's the problem: On some platforms, linking against OpenThreads
# is not enough and explicit linking to the underlying thread library
# is also required (e.g. FreeBSD). But OpenThreads may be built with different
# backends (Pthreads, Sproc, Windows) so we don't know what the underlying
# thread library is because some platforms support multiple backends (e.g.
# IRIX supports Sproc and Pthreads). Linking all libraries won't work
# because the libraries may be incompatible.
# So the current solution is to attempt best guess linking and exempt certain
# cases. With IRIX, we're going to hope explicit linking to the underlying
# library is not necessary. We currently don't case for pthreads on Windows
# which might be an issue on things like Cygwin. This may need to be fixed.
FIND_PACKAGE(Threads)
IF(CMAKE_SYSTEM MATCHES IRI

Re: [osg-users] Initial cut at CMake support + branch of osgEphemeris

2009-04-14 Thread Philip Lowman
On Fri, Apr 10, 2009 at 11:33 AM, Robert Osfield
wrote:

> Which goes pretty sweetly till it tries to link the plugin.  These are the
> errors I get:
>
> [ 86%] Building CXX object
> src/osgEphemeris/CMakeFiles/osgEphemeris.dir/StarField.o
> [ 93%] Building CXX object
> src/osgEphemeris/CMakeFiles/osgEphemeris.dir/sun_image.o
> Linking CXX shared library ../../lib/libosgEphemeris.so
> [ 93%] Built target osgEphemeris
> Scanning dependencies of target osgdb_osgephemeris
> [100%] Building CXX object
> src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/IO_EphemerisModel.o
> Linking CXX shared module /osgPlugins-2.9.2/osgdb_osgephemeris.so
> /usr/bin/ld: cannot open output file
> /osgPlugins-2.9.2/osgdb_osgephemeris.so: No such file or directory
> collect2: ld returned 1 exit status
> make[2]: *** [/osgPlugins-2.9.2/osgdb_osgephemeris.so] Error 1
> make[1]: ***
> [src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/all] Error 2


Hmm, server appears down for me so I can't have a look at this right now.
I'm guessing that the problem has something to do with setting the PREFIX
target property which I think is what OSG uses to force the plugins into an
osgPlugins-x.y.z folder?

Could you add the following after the declaration of
add_library(osgephemeris MODULE...)

message("CMAKE_LIBRARY_PATH = ${CMAKE_LIBRARY_PATH}")
message("CMAKE_LIBRARY_OUTPUT_DIRECTORY =
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
get_target_properties(the_prefix osgephemeris PREFIX)
message("the prefix is = ${the_prefix}")

-- 
Philip Lowman
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Initial cut at CMake support + branch of osgEphemeris

2009-04-13 Thread Robert Osfield
On Mon, Apr 13, 2009 at 8:52 PM, Ralf Stokholm wrote:

> Hi Robert
>
> Just a small heads up that the SimCore project which is an
> "addon/extension" of Delta3d is using osgEphemeris, they are building
> using Cmake, so their might be a hint to get from that one.
>
>
> http://delta3d-extras.svn.sourceforge.net/svnroot/delta3d-extras/SimulationCore/trunk/ext
>

Thanks for the link, looking at the various directories suggests that only
the lib has cmake support, the plugin doesn't so it's any help.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Initial cut at CMake support + branch of osgEphemeris

2009-04-13 Thread Ralf Stokholm
Hi Robert

Just a small heads up that the SimCore project which is an
"addon/extension" of Delta3d is using osgEphemeris, they are building
using Cmake, so their might be a hint to get from that one.

http://delta3d-extras.svn.sourceforge.net/svnroot/delta3d-extras/SimulationCore/trunk/ext

Brgs.

Ralf Stokholm

2009/4/10 Robert Osfield :
> Hi All,
>
> I'm off doing training next week and one of the topics may well be touch
> upon is osgEphemeris so I've pulled down the CVS from Don's AndesEnginnering
> website and had a bash at getting it, and it's dependency of Producer
> compiling.  I struggled to get things working so ended up having a bash at
> porting osgEphemeris to using CMake and against the latest OSG rev.
>
> To get the build working I've drawn the CMake files from VPB, OSG and
> osgEarth, it's a bit of hack... but it's almost working.  So far the
> osgEphemeris library itself is compiling and linking, and the plugin is
> compiling, but the paths are failing.  So... I was wondering if some helpful
> soul might be able to spot my CMake script error(s).
>
> I've put up by branch of osgEphemeris on the openscenegraph.org subversion
> repository, you can grab it from:
>
>     svn co http://www.openscenegraph.org/svn/osgEphemeris/trunk osgEphemeris
>
> Then to compile it's the usual OSG/Cmake routine, and under unices it looks
> like:
>
>     ./configure
>    make
>
> Which goes pretty sweetly till it tries to link the plugin.  These are the
> errors I get:
>
> [ 86%] Building CXX object
> src/osgEphemeris/CMakeFiles/osgEphemeris.dir/StarField.o
> [ 93%] Building CXX object
> src/osgEphemeris/CMakeFiles/osgEphemeris.dir/sun_image.o
> Linking CXX shared library ../../lib/libosgEphemeris.so
> [ 93%] Built target osgEphemeris
> Scanning dependencies of target osgdb_osgephemeris
> [100%] Building CXX object
> src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/IO_EphemerisModel.o
> Linking CXX shared module /osgPlugins-2.9.2/osgdb_osgephemeris.so
> /usr/bin/ld: cannot open output file
> /osgPlugins-2.9.2/osgdb_osgephemeris.so: No such file or directory
> collect2: ld returned 1 exit status
> make[2]: *** [/osgPlugins-2.9.2/osgdb_osgephemeris.so] Error 1
> make[1]: ***
> [src/osgPlugins/osgEphemeris/CMakeFiles/osgdb_osgephemeris.dir/all] Error 2
>
> The error seems to be in the path to what should
> osgEmpheris/lib/osgPlugins-2.9.2, but instead it's just got the path
> /osgPlugins-2.9.2/osgdb_osgephemeris.so.  While I've tried to honour how the
> OSG does thing w.r.t plugins something is obviously wrong..   Hopefully what
> is wrong might ring a bell to the OSG/Cmake guru's.
>
> I haven't yet put together an osgViewer based example but this should be
> pretty straight forward.
>
> Cheers,
> Robert.
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org