Hello Luigi,

I have set OSG_DIR and GDAL_DIR as env var. Apply your patch but there are
still
some errors :

This projet requires some variables to be set and cmake can not find them :
OPENTHREAD_LIBRARY
OSGDB_LIBRARY
OSGFX_LIBRARY
OSGUTIL_LIBRARY
OSGVIEWER_LIBRARY
OSG_LIBRARY


Then, I have modified the file (with the help of Damien, one of my
colleague:-)
) : VirtualPlanetBuilder\CMakeModules\FindOSG.cmake
Modification is in *red*
**

# Locate gdal
# This module defines
# OSG_LIBRARY
# 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.

FIND_PATH(OSG_INCLUDE_DIR osg/Node
   ${OSG_DIR}/include
   $ENV{OSG_DIR}/include
   $ENV{OSG_DIR}
   $ENV{OSGDIR}/include
   $ENV{OSGDIR}
   $ENV{OSG_ROOT}/include
   ~/Library/Frameworks
   /Library/Frameworks
   /usr/local/include
   /usr/include
   /sw/include # Fink
   /opt/local/include # DarwinPorts
   /opt/csw/include # Blastwave
   /opt/include
   [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\
Manager\\Environment;OSG_ROOT]/include
   /usr/freeware/include
)

MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)

   FIND_LIBRARY("${MYLIBRARY}_DEBUG"
       NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
       PATHS
       ${OSG_DIR}/lib
       $ENV{OSG_DIR}/lib
       $ENV{OSG_DIR}
       $ENV{OSGDIR}/lib
       $ENV{OSGDIR}
       $ENV{OSG_ROOT}/lib
       ~/Library/Frameworks
       /Library/Frameworks
       /usr/local/lib
       /usr/lib
       /sw/lib
       /opt/local/lib
       /opt/csw/lib
       /opt/lib
       [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\
Manager\\Environment;OSG_ROOT]/lib
       /usr/freeware/lib64
   )

   FIND_LIBRARY("${MYLIBRARY}"
       NAMES ${MYLIBRARYNAME}
       PATHS
       ${OSG_DIR}/lib
       $ENV{OSG_DIR}/lib*/release*
       $ENV{OSG_DIR}
       $ENV{OSGDIR}/lib
       $ENV{OSGDIR}
       $ENV{OSG_ROOT}/lib
       ~/Library/Frameworks
       /Library/Frameworks
       /usr/local/lib
       /usr/lib
       /sw/lib
       /opt/local/lib
       /opt/csw/lib
       /opt/lib
       [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)
   ENDIF( NOT ${MYLIBRARY}_DEBUG)

ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)

FIND_OSG_LIBRARY(OSG_LIBRARY osg)
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)

SET(OSG_FOUND "NO")
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
   SET(OSG_FOUND "YES")
ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)

With this modification, no errors, and the project compile fine !

Christophe.


2007/7/12, Luigi Calori <[EMAIL PROTECTED]>:


Here is my patches:

I have modified the FindOSG and FindGDAL scripts to search not only env
var OSG_DIR and GDAL_DIR but, before
cmake variables OSG_DIR and GDAL_DIR that can be specified either in the
CMake gui or via  the -d OSG_DIR=<install path of osg, what you have
specified in CMAKE_INSTALL_PREFIX at osg cmake time>

I think this is handier to use than env var (under window you have to
remember either to set a user or system env var or to launch Cmake from
a shell where you have set your env)

I' ve built osgdem against GDAL found from a pre-built installation of
FWTools (1.2.0)     http://fwtools.maptools.org/
I' ve also modified to select debug osg libraries if present when
building in debug mode
I had to add osgViewer to the osgdem app to be able to open windows. Not
completely sure it is absolutely needed.

The patch has been extracted under windows with the following command
against the current ( 631) svn version
svn -x -u -x --ignore-eol-style diff | unix2dos | zip

Hope it helps

Luigi Calori

If it works for you, let us know, so eventually Robert can check in the
mods.


christophe loustaunau wrote:

> Ok, so I will wait for this changes.
>
> Thanks !
>
>
> 2007/7/12, Robert Osfield <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>:
>
>     Hi Christophe,
>
>     Luigi sent a post a few days about about build VPB under Windows
using
>     the new Cmake build.  He mentioned that he had to make a few changes
>     to CMakeLists.txt files and source files but hasn't submitted any
>     changes yet though.
>
>     Robert.
>


_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to