OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Installing library plugins to the osgPlugins-VERSION directory

Goto page 1, 2  Next
 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
Jason Beverage
Guest





PostPosted: Thu Jan 29, 2009 3:17 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hello CMake Wizards,

We've had a couple of requests on osgEarth to install our osgDB plugins directly to the osgPlugins-VERSION directory. Is there a way in CMake that I can determine what that directory would be?

In the OpenSceneGraph's CMakeLists.txt the plugin directory is like so:

SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
SET(OSG_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION})

Can I somehow grab the OpenSceneGraph version that osgEarth was built against in CMake?

Thanks in advance!

Jason

------------------
Post generated by Mail2Forum
Back to top
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbrücken, Germany

PostPosted: Thu Jan 29, 2009 3:25 pm    Post subject:
Reply with quote

Hi Jason,

take a look into osgPPU's CMake files. There I use the output of osgversion to find out the version number of the current osg. In this way you could determine the version and install the plugin where you need them.

Best regards,
art
Back to top
View user's profile Send private message Visit poster's website
Skylark (Jean-Sébastien Guay)
Professional


Joined: 05 Jan 2009
Posts: 2249

PostPosted: Thu Jan 29, 2009 3:28 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi Jason,

Quote:
We've had a couple of requests on osgEarth to install our osgDB plugins
directly to the osgPlugins-VERSION directory. Is there a way in CMake
that I can determine what that directory would be?

I think Art does something for this in his CMake files for osgPPU... You
could grab osgPPU and see.

It would be nice to have a generalized FindOSG.cmake file that would be
distributed with OSG and which any nodekits / projects would use to get
this for free. Or maybe this already exists?

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Jason Beverage
Guest





PostPosted: Thu Jan 29, 2009 3:30 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Thanks Art and JS, I'll take a look at osgPPU and see what I can come up with.

Jason

On Thu, Jan 29, 2009 at 10:28 AM, Jean-Sébastien Guay < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Jason,

Quote:
We've had a couple of requests on osgEarth to install our osgDB plugins directly to the osgPlugins-VERSION directory. Is there a way in CMake that I can determine what that directory would be?


I think Art does something for this in his CMake files for osgPPU... You could grab osgPPU and see.

It would be nice to have a generalized FindOSG.cmake file that would be distributed with OSG and which any nodekits / projects would use to get this for free. Or maybe this already exists?

J-S
--
______________________________________________________
Jean-Sebastien Guay (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://www.cm-labs.com/
http://whitestar02.webhop.org/

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Thu Jan 29, 2009 3:34 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi JS et al,

On Thu, Jan 29, 2009 at 3:28 PM, Jean-Sébastien Guay
<> wrote:
Quote:
It would be nice to have a generalized FindOSG.cmake file that would be
distributed with OSG and which any nodekits / projects would use to get this
for free. Or maybe this already exists?

There is a OpenSceneGraph/CMakeModules/FindOSG.cmake that can be used
by projects. I've just updated the contents from the version I use
in Present3D - this one is more up to date and handles use of env vars
much better. It doesn't yet have version number querying but this
could be added.

Robert.


------------------
Post generated by Mail2Forum
Back to top
Luigi Calori
Guest





PostPosted: Thu Jan 29, 2009 3:39 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

This is my FindOSG file I use for getting dll to copy , it get the
version also... see
#get version numbers
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --version-number
OUTPUT_VARIABLE OSG_VERSION_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --so-number OUTPUT_VARIABLE
OSG_SO_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS
--openthreads-soversion-number OUTPUT_VARIABLE OSG_OT_SO_NUMBER)

I agree the FindOSG should be distributed along OSG.
My version need to find .dll under windows to copy them into a packaged
distribution (Firefox plugin)
I use it under Windows and Linux not tested on Mac

Hope it helps

Luigi


Jason Beverage ha scritto:
Quote:
Thanks Art and JS, I'll take a look at osgPPU and see what I can come
up with.

Jason

On Thu, Jan 29, 2009 at 10:28 AM, Jean-Sébastien Guay
<
<mailto:>> wrote:

Hi Jason,


We've had a couple of requests on osgEarth to install our
osgDB plugins directly to the osgPlugins-VERSION directory.
Is there a way in CMake that I can determine what that
directory would be?


I think Art does something for this in his CMake files for
osgPPU... You could grab osgPPU and see.

It would be nice to have a generalized FindOSG.cmake file that
would be distributed with OSG and which any nodekits / projects
would use to get this for free. Or maybe this already exists?

J-S
--
______________________________________________________
Jean-Sebastien Guay
<mailto:>
http://www.cm-labs.com/
http://whitestar02.webhop.org/

_______________________________________________
osg-users mailing list

<mailto:>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------------------------------------------------------------





# 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
)

FIND_PROGRAM(OSG_VERSION_APP
NAMES osgversion osgversiond
PATHS
${OSG_DIR}/bin
$ENV{OSG_DIR}/bin
$ENV{OSG_DIR}
$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(OSG_VERSION_APP)
#define binary folder
IF(WIN32)
GET_FILENAME_COMPONENT(OSG_BINARY_DIR ${OSG_VERSION_APP} PATH)
ELSE(WIN32)
GET_FILENAME_COMPONENT(tmp ${OSG_VERSION_APP} PATH)
GET_FILENAME_COMPONENT(tmp ${tmp} PATH)
SET(OSG_BINARY_DIR "${tmp}/lib")
IF(UNIX)
SET(ENV{LD_LIBRARY_PATH} "${OSG_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
ENDIF(UNIX)
ENDIF(WIN32)


#get version numbers
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --version-number OUTPUT_VARIABLE OSG_VERSION_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --so-number OUTPUT_VARIABLE OSG_SO_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --openthreads-soversion-number OUTPUT_VARIABLE OSG_OT_SO_NUMBER)
# Automatically detected build options
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS Matrix::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_MATRIX)
IF(OSG_USE_FLOAT_MATRIX MATCHES "float")
LIST(APPEND OSG_DEFINITIONS -DOSG_USE_FLOAT_MATRIX)
ENDIF(OSG_USE_FLOAT_MATRIX MATCHES "float")

EXEC_PROGRAM(${OSG_VERSION_APP} ARGS Plane::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_PLANE)
IF(OSG_USE_FLOAT_PLANE MATCHES "float")
LIST(APPEND OSG_DEFINITIONS -DOSG_USE_FLOAT_PLANE)
ENDIF(OSG_USE_FLOAT_PLANE MATCHES "float")

EXEC_PROGRAM(${OSG_VERSION_APP} ARGS BoundingSphere::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_BOUNDINGSPHERE)
IF(OSG_USE_FLOAT_BOUNDINGSPHERE MATCHES "double")
LIST(APPEND OSG_DEFINITIONS -DOSG_USE_DOUBLE_BOUNDINGSPHERE)
ENDIF(OSG_USE_FLOAT_BOUNDINGSPHERE MATCHES "double")

EXEC_PROGRAM(${OSG_VERSION_APP} ARGS BoundingBox::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_BOUNDINGBOX)
IF(OSG_USE_FLOAT_BOUNDINGBOX MATCHES "double")
LIST(APPEND OSG_DEFINITIONS -DOSG_USE_DOUBLE_BOUNDINGBOX)
ENDIF(OSG_USE_FLOAT_BOUNDINGBOX MATCHES "double")

MACRO(OSG_FIND_MODULE MYVAR MYNAME)
IF(MYNAME MATCHES OpenThreads)
IF(WIN32)
SET(MYFILE "${OSG_BINARY_DIR}/ot${OSG_OT_SO_NUMBER}-${MYNAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
ELSE(WIN32)
SET(MYFILE "${OSG_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}${MYNAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${OSG_OT_SO_NUMBER}")
ENDIF(WIN32)
ELSE(MYNAME MATCHES OpenThreads)
IF(WIN32)
SET(MYFILE "${OSG_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}osg${OSG_SO_NUMBER}-${MYNAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
ELSE(WIN32)
SET(MYFILE "${OSG_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}${MYNAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${OSG_SO_NUMBER}")
ENDIF(WIN32)
ENDIF(MYNAME MATCHES OpenThreads)
#message("lloking for -->${MYFILE}<--${CMAKE_SHARED_MODULE_PREFIX}")
IF(EXISTS ${MYFILE})
#message("found for -->${MYFILE}<--")
SET(${MYVAR} ${MYFILE})
ELSE(EXISTS ${MYFILE})
SET(${MYVAR} "")
ENDIF(EXISTS ${MYFILE})
ENDMACRO(OSG_FIND_MODULE MYVAR MYNAME)

MACRO(OSG_FIND_PLUGIN MYVAR MYNAME)
SET(MYFILE "${OSG_BINARY_DIR}/osgPlugins-${OSG_VERSION_NUMBER}/osgdb_${MYNAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
#message("lloking for -->${MYFILE}<--")
IF(EXISTS ${MYFILE})
#message("found for -->${MYFILE}<--")
SET(${MYVAR} ${MYFILE})
ELSE(EXISTS ${MYFILE})
SET(${MYVAR} "")
ENDIF(EXISTS ${MYFILE})
ENDMACRO(OSG_FIND_PLUGIN MYVAR MYNAME)

MACRO(OSG_COPY_MODULE_CUSTOM_COMMAND MYNAMES MYDIR MYDEP)
SET(mod_list "")
foreach(MYNAME ${MYNAMES})
OSG_FIND_MODULE(mytmp ${MYNAME})
if(mytmp)
GET_FILENAME_COMPONENT(myfile ${mytmp} NAME)
LIST(APPEND ${MYDEP} "${MYDIR}/${myfile}")
add_custom_command(
OUTPUT "${MYDIR}/${myfile}"
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${MYDIR}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${mytmp} "${MYDIR}/${myfile}"
#is unclear if the .rule are needed or not#
#COMMAND ${CMAKE_COMMAND} ARGS -E remove "${MYDIR}/${myfile}.rule"
)
endif(mytmp)
endforeach(MYNAME)
#SET(${MYDEP} ${mod_list})
ENDMACRO(OSG_COPY_MODULE_CUSTOM_COMMAND MYNAMES MYDIR MYDEP)

MACRO(OSG_COPY_PLUGIN_CUSTOM_COMMAND MYNAMES MYDIR MYDEP)
SET(mod_list "")
foreach(MYNAME ${MYNAMES})
OSG_FIND_PLUGIN(mytmp ${MYNAME})
if(mytmp)
GET_FILENAME_COMPONENT(mytmp1 ${mytmp} NAME)
GET_FILENAME_COMPONENT(mytmp2 ${mytmp} PATH)
GET_FILENAME_COMPONENT(mytmp2 ${mytmp2} NAME)
LIST(APPEND ${MYDEP} "${MYDIR}/${mytmp2}/${mytmp1}")
add_custom_command(
OUTPUT "${MYDIR}/${mytmp2}/${mytmp1}"
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${MYDIR}/${mytmp2}"
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${mytmp} "${MYDIR}/${mytmp2}/${mytmp1}"
#is unclear if the .rule are needed or not#
#COMMAND ${CMAKE_COMMAND} ARGS -E remove "${MYDIR}/${mytmp2}/${mytmp1}.rule"
)
endif(mytmp)
endforeach(MYNAME)
#SET(${MYDEP} ${mod_list})
ENDMACRO(OSG_COPY_PLUGIN_CUSTOM_COMMAND MYNAMES MYDIR MYDEP)
ENDIF(OSG_VERSION_APP)


MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)

FIND_LIBRARY("${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}d"
PATHS
${OSG_DIR}/lib/Debug
${OSG_DIR}/lib
$ENV{OSG_DIR}/lib/debug
$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/Release
${OSG_DIR}/lib
$ENV{OSG_DIR}/lib/Release
$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
)

IF( NOT ${MYLIBRARY}_DEBUG)
IF(${MYLIBRARY})
SET(${MYLIBRARY}_DEBUG ${${MYLIBRARY}})
ENDIF(${MYLIBRARY})
ENDIF( NOT ${MYLIBRARY}_DEBUG)
IF( NOT ${MYLIBRARY})
IF(${MYLIBRARY}_DEBUG)
SET(${MYLIBRARY} ${${MYLIBRARY}_DEBUG})
ENDIF(${MYLIBRARY}_DEBUG)
ENDIF( NOT ${MYLIBRARY})

MARK_AS_ADVANCED(${MYLIBRARY} "${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(OSGGA_LIBRARY osgGA)
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim)
FIND_OSG_LIBRARY(OSGMANIPULATOR_LIBRARY osgManipulator)
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)

MACRO(OSG_LINK_WITH_VARIABLES TRGTNAME)
FOREACH(varname ${ARGN})
IF(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
ELSE(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" )
ENDIF(${varname}_DEBUG)
ENDFOREACH(varname)
ENDMACRO(OSG_LINK_WITH_VARIABLES TRGTNAME)


MARK_AS_ADVANCED(OSG_BINARY_DIR OSG_INCLUDE_DIR)

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



------------------
Post generated by Mail2Forum
Back to top
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbrücken, Germany

PostPosted: Thu Jan 29, 2009 3:41 pm    Post subject:
Reply with quote

Hi Jason,

sorry, so that you don't search long time before find the correct thing, just take a look into OsgPPUMacroUtils.cmake in CMakeModules directory. The very first macro is what you are looking for.
Then jus call this macro somehwerte from your main cmake file and evrything will be fine Wink

cheers
Back to top
View user's profile Send private message Visit poster's website
Skylark (Jean-Sébastien Guay)
Professional


Joined: 05 Jan 2009
Posts: 2249

PostPosted: Thu Jan 29, 2009 4:00 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi Robert,

Quote:
There is a OpenSceneGraph/CMakeModules/FindOSG.cmake that can be used
by projects. I've just updated the contents from the version I use
in Present3D - this one is more up to date and handles use of env vars
much better. It doesn't yet have version number querying but this
could be added.

Cool, and yes I think that would be useful. Perhaps there could just be
an OSG_PLUGINS_DIR variable that would be set to the right value and
that the project would just use (in addition to the version which might
be useful for other things too).

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Jason Beverage
Guest





PostPosted: Fri Jan 30, 2009 3:31 pm    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi Art,

Thanks for your tip, it worked great! osgEarth now installs its plugins to the osgPlugins-version directory.

Thanks again!

J

On Thu, Jan 29, 2009 at 10:25 AM, Art Tevs < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Jason,

take a look into osgPPU's CMake files. There I use the output of osgversion to find out the version number of the current osg. In this way you could determine the version and install the plugin where you need them.

Best regards,
art

------------------
Read this topic online here:
http://osgforum.tevs.eu/viewtopic.php?p=5437#5437





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbrücken, Germany

PostPosted: Fri Jan 30, 2009 4:20 pm    Post subject:
Re: Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi Jason,

you are welcome!

best regards,
art


Jason Beverage wrote:
Hi Art,

Thanks for your tip, it worked great! osgEarth now installs its plugins to the osgPlugins-version directory.
Back to top
View user's profile Send private message Visit poster's website
Philip Lowman
Guest





PostPosted: Sat Jan 31, 2009 2:20 am    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

On Thu, Jan 29, 2009 at 10:39 AM, Luigi Calori < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
This is my FindOSG file I use for getting dll to copy , it get the version also... see
#get version numbers
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --version-number OUTPUT_VARIABLE OSG_VERSION_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --so-number OUTPUT_VARIABLE OSG_SO_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --openthreads-soversion-number OUTPUT_VARIABLE OSG_OT_SO_NUMBER)

I agree the FindOSG should be distributed along OSG.
My version need to find .dll under windows to copy them into a packaged distribution (Firefox plugin)
I use it under Windows and Linux not tested on Mac

A lot of work has been done recently in CVS CMake to improve the Find modules shipped with CMake (originally written by Eric Wing) to better work with the OSG. I believe most of the features Luigi has added to his FindOSG.cmake should be present there with a couple of improvements:

1. Component support
2. It should be trivial to add find modules for new nodekits (bundled with OSG or not) without modifying the core FindOpenSceneGraph.cmake file
3. Version support and enforcement (by header file parsing)
4. Backwards compatibility with older versions of OSG that lack newer node kits. It will not search for nodekits until told to do so.

I left out exposing the SO version figuring that users that need this level of detail can just include osg/Version (or osg/Config in the case of double/float issues) and write their own configure tests. Also SO versioning isn't available on all versions of the OSG anyways.

Here's a brief synopsis of how to use it. As you can see, it is very easy for the end user. It should work anywhere from 2.0.0 to 2.7.9 and might even work with 1.2.0 although I don't have binaries around to test this. =) Please see the documentation for more details.

====
find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgGA osgViewer osgUtil)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
====

If you feel anything is missing or if you try it and it doesn't work please file a bug in the CMake bug tracker. I and others in the CMake community will support these modules with your patches (especially now that I have commit access =) ). All of the above should be included in the upcoming CMake 2.6.3 release. If you prefer not to muck with CVS I will post when an RC that includes the modules is available.

One minor downside to it is that if you can't set cmake_minimum_required(VERSION 2.6.3) for your project, you'll have to include more than one file in your CMAKE_MODULE_PATH. This is also a bit of a good thing, however, as developers should be able to simply distribute a 5 line FindosgFoo.cmake for their new nodekits and there will be no need to continuously patch a FindOpenSceneGraph.cmake over the long term as it will be distributed with CMake. Also if your project doesn't need the osgFoo nodekit you would never need to download the FindosgFoo.cmake file.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/?root=CMake
See:
FindOpenSceneGraph.cmake
Findosg_functions.cmake
Findosg.cmake (depends on Findosg_functions.cmake)
FindosgDB.cmake (depends on Findosg_functions.cmake)
Findosg*.cmake (depends on Findosg_functions.cmake)
FindOpenThreads.cmake




--
Philip Lowman

------------------
Post generated by Mail2Forum
Back to top
Luigi Calori
Guest





PostPosted: Sat Jan 31, 2009 9:22 am    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi Philip: I did not know you has access to the CMake CVS, good to know,.
I had to change my FindOSG as I need to find also .dll and .so on
windows and linux.
So I needed both version as well soversion, so I decided to run the
osgversion utility
Furthermore, it seem to me that osgversion provide other flags to check
for defines that have been specified in the build process of the osg
found. like OSG_USE_FLOAT_MATRIX, OSG_USE_FLOAT_PLANE or
OSG_USE_FLOAT_BOUNDINGSPHERE, are those still required to be defined
when compiling against osg or they are not used anymore?

I decided to grab VPB version of FindOSG as really do not fully
understand the nedd of a separate Findosg<component> .
I see that other Find modules that have multiple components such as
ImageMagick are implemented as single file.
In my opinion, having a single file is more handy if you do not use cvs
CMake and also help in keeping the distributed CMake Modules directory
cleaned,
I think we could just find all the components available in the
"standard" place and test the requirements against them.

If some of the macro I use for copying lib and plugins dll could be
useful to someone else, let me know, I can try to assemble them better.

Luigi




Philip Lowman ha scritto:
Quote:
On Thu, Jan 29, 2009 at 10:39 AM, Luigi Calori <
<mailto:>> wrote:

This is my FindOSG file I use for getting dll to copy , it get the
version also... see
#get version numbers
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --version-number
OUTPUT_VARIABLE OSG_VERSION_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --so-number
OUTPUT_VARIABLE OSG_SO_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS
--openthreads-soversion-number OUTPUT_VARIABLE OSG_OT_SO_NUMBER)

I agree the FindOSG should be distributed along OSG.
My version need to find .dll under windows to copy them into a
packaged distribution (Firefox plugin)
I use it under Windows and Linux not tested on Mac


A lot of work has been done recently in CVS CMake to improve the Find
modules shipped with CMake (originally written by Eric Wing) to better
work with the OSG. I believe most of the features Luigi has added to
his FindOSG.cmake should be present there with a couple of improvements:

1. Component support
2. It should be trivial to add find modules for new nodekits (bundled
with OSG or not) without modifying the core FindOpenSceneGraph.cmake file
3. Version support and enforcement (by header file parsing)
4. Backwards compatibility with older versions of OSG that lack newer
node kits. It will not search for nodekits until told to do so.

I left out exposing the SO version figuring that users that need this
level of detail can just include osg/Version (or osg/Config in the
case of double/float issues) and write their own configure tests.
Also SO versioning isn't available on all versions of the OSG anyways.

Here's a brief synopsis of how to use it. As you can see, it is very
easy for the end user. It should work anywhere from 2.0.0 to 2.7.9
and might even work with 1.2.0 although I don't have binaries around
to test this. =) Please see the documentation for more details.

====
find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgGA osgViewer osgUtil)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
====

If you feel anything is missing or if you try it and it doesn't work
please file a bug in the CMake bug tracker. I and others in the CMake
community will support these modules with your patches (especially now
that I have commit access =) ). All of the above should be included
in the upcoming CMake 2.6.3 release. If you prefer not to muck with
CVS I will post when an RC that includes the modules is available.

One minor downside to it is that if you can't set
cmake_minimum_required(VERSION 2.6.3) for your project, you'll have to
include more than one file in your CMAKE_MODULE_PATH. This is also a
bit of a good thing, however, as developers should be able to simply
distribute a 5 line FindosgFoo.cmake for their new nodekits and there
will be no need to continuously patch a FindOpenSceneGraph.cmake over
the long term as it will be distributed with CMake. Also if your
project doesn't need the osgFoo nodekit you would never need to
download the FindosgFoo.cmake file.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/?root=CMake
See:
FindOpenSceneGraph.cmake
Findosg_functions.cmake
Findosg.cmake (depends on Findosg_functions.cmake)
FindosgDB.cmake (depends on Findosg_functions.cmake)
Findosg*.cmake (depends on Findosg_functions.cmake)
FindOpenThreads.cmake


--
Philip Lowman
------------------------------------------------------------------------






------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Sat Jan 31, 2009 10:07 am    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

Hi Philip,

It's good to see Cmake support for OpenSceneGraph being improved. I
see it's moved on quite a bit from my own little experiments with
FindOSG.cmake for VirtualPlanetBuilder + Present3D.

I've just reviewed the new OSG related Cmake files in CMake CVS and
it's enough different that I can't assess whether or not something
that I addressed recently in the P3D FindOSG.cmake (back ported to
OpenSceneGraph/CMakeModules/FindOSG.cmake) is also addressed. So
perhaps you can clarify this for me.

The problem that I addressed was thatthat CMake was search system
directories for the OSG headers and libs prior to searching the OSGDIR
env vars, this meant that if an older OSG version was already
installed but a a different version was compiled locally and pointed
at by the OSGDIR the installed version would always be found. To fix
this I had to split the FIND* calls in such as a way that the OSGDIR
path was checked in one FIND* call, then the system directories were
called afterwards in their of FIND* call.

In the CMake CVS version of FindOpenSceneGraph is it still possible to
override the system paths or explicitly use a local version of the
OSG?

Robert.

On Sat, Jan 31, 2009 at 2:20 AM, Philip Lowman <> wrote:
Quote:
On Thu, Jan 29, 2009 at 10:39 AM, Luigi Calori <> wrote:
Quote:

This is my FindOSG file I use for getting dll to copy , it get the version
also... see
#get version numbers
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --version-number OUTPUT_VARIABLE
OSG_VERSION_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --so-number OUTPUT_VARIABLE
OSG_SO_NUMBER)
EXEC_PROGRAM(${OSG_VERSION_APP} ARGS --openthreads-soversion-number
OUTPUT_VARIABLE OSG_OT_SO_NUMBER)

I agree the FindOSG should be distributed along OSG.
My version need to find .dll under windows to copy them into a packaged
distribution (Firefox plugin)
I use it under Windows and Linux not tested on Mac

A lot of work has been done recently in CVS CMake to improve the Find
modules shipped with CMake (originally written by Eric Wing) to better work
with the OSG. I believe most of the features Luigi has added to his
FindOSG.cmake should be present there with a couple of improvements:

1. Component support
2. It should be trivial to add find modules for new nodekits (bundled with
OSG or not) without modifying the core FindOpenSceneGraph.cmake file
3. Version support and enforcement (by header file parsing)
4. Backwards compatibility with older versions of OSG that lack newer node
kits. It will not search for nodekits until told to do so.

I left out exposing the SO version figuring that users that need this level
of detail can just include osg/Version (or osg/Config in the case of
double/float issues) and write their own configure tests. Also SO
versioning isn't available on all versions of the OSG anyways.

Here's a brief synopsis of how to use it. As you can see, it is very easy
for the end user. It should work anywhere from 2.0.0 to 2.7.9 and might
even work with 1.2.0 although I don't have binaries around to test this. =)
Please see the documentation for more details.

====
find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgGA osgViewer osgUtil)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
====

If you feel anything is missing or if you try it and it doesn't work please
file a bug in the CMake bug tracker. I and others in the CMake community
will support these modules with your patches (especially now that I have
commit access =) ). All of the above should be included in the upcoming
CMake 2.6.3 release. If you prefer not to muck with CVS I will post when an
RC that includes the modules is available.

One minor downside to it is that if you can't set
cmake_minimum_required(VERSION 2.6.3) for your project, you'll have to
include more than one file in your CMAKE_MODULE_PATH. This is also a bit of
a good thing, however, as developers should be able to simply distribute a 5
line FindosgFoo.cmake for their new nodekits and there will be no need to
continuously patch a FindOpenSceneGraph.cmake over the long term as it will
be distributed with CMake. Also if your project doesn't need the osgFoo
nodekit you would never need to download the FindosgFoo.cmake file.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/?root=CMake
See:
FindOpenSceneGraph.cmake
Findosg_functions.cmake
Findosg.cmake (depends on Findosg_functions.cmake)
FindosgDB.cmake (depends on Findosg_functions.cmake)
Findosg*.cmake (depends on Findosg_functions.cmake)
FindOpenThreads.cmake


--
Philip Lowman






------------------
Post generated by Mail2Forum
Back to top
Philip Lowman
Guest





PostPosted: Sat Jan 31, 2009 10:15 am    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

On Sat, Jan 31, 2009 at 4:22 AM, Luigi Calori < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Philip: I did not know you has access to the CMake CVS, good to know,.
I had to change my FindOSG as I need to find also .dll and .so on windows and linux.
So I needed both version as well soversion, so I decided to run the osgversion utility
Furthermore, it seem to me that osgversion provide other flags to check for defines that have been specified in the build process of the osg found. like OSG_USE_FLOAT_MATRIX, OSG_USE_FLOAT_PLANE or OSG_USE_FLOAT_BOUNDINGSPHERE, are those still required to be defined when compiling against osg or they are not used anymore?

That is a good question, I'm not sure when <osg/Config> was added to the build in relation to those preprocessor definitions being added.


Quote:

I decided to grab VPB version of FindOSG as really do not fully understand the nedd of a separate Findosg<component> .
I see that other Find modules that have multiple components such as ImageMagick are implemented as single file.
In my opinion, having a single file is more handy if you do not use cvs CMake and also help in keeping the distributed CMake Modules directory cleaned,
I think we could just find all the components available in the "standard" place and test the requirements against them.

We can't remove Findosg<Component>.cmake from CMake for backwards compatibility reasons so I've instead focused on making those files as tiny as possible and clumping the function calls in Findosg_functions.cmake.

I think eventually the extensibility of FindOpenSceneGraph.cmake will pay off. In the long term it can be used by 3rd party nodekit developers so they can write their own FindosgFoo.cmake to allow their nodekits to be found alongside the OSG, without having to worry about submitting code patches to allow their nodekit to be detected.

Obviously in the short term so long as you can't declare CMake minimum version >= 2.6.3 the only real annoyance (assuming you want to use this at all) is needing to download & CM 4+x files in your CMAKE_MODULE_PATH (where x = the number of nodekits you use in your project). Of these 4+x files only 2 will likely ever change, Findosg_functions.cmake & FindOpenSceneGraph.cmake. Findosg.cmake & FindOpenThreads.cmake are obviously always required for very good reasons. =)


Quote:
If some of the macro I use for copying lib and plugins dll could be useful to someone else, let me know, I can try to assemble them better.

There is something new in CMake called GetPrerequisites.cmake you may want to investigate. I assume it may still may have some bugs in it, but it aims at determining the DLL dependencies of your LIB files at which point you can do whatever you want with the list (copy to build tree, INSTALL(), etc.)

Making it easier for new CMake users to copy files to either MSVC build trees or standard build trees is something I'd like to see supported within CMake/Modules with an easy to use API. Everybody seems to have either come up with their own home-brewed solution for this one or have cobbled together something from mailing list posts.



--
Philip Lowman

------------------
Post generated by Mail2Forum
Back to top
Philip Lowman
Guest





PostPosted: Sat Jan 31, 2009 10:38 am    Post subject:
Installing library plugins to the osgPlugins-VERSION directory
Reply with quote

On Sat, Jan 31, 2009 at 5:07 AM, Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Philip,

It's good to see Cmake support for OpenSceneGraph being improved. I
see it's moved on quite a bit from my own little experiments with
FindOSG.cmake for VirtualPlanetBuilder + Present3D.

I've just reviewed the new OSG related Cmake files in CMake CVS and
it's enough different that I can't assess whether or not something
that I addressed recently in the P3D FindOSG.cmake (back ported to
OpenSceneGraph/CMakeModules/FindOSG.cmake) is also addressed. So
perhaps you can clarify this for me.

The problem that I addressed was thatthat CMake was search system
directories for the OSG headers and libs prior to searching the OSGDIR
env vars, this meant that if an older OSG version was already
installed but a a different version was compiled locally and pointed
at by the OSGDIR the installed version would always be found. To fix
this I had to split the FIND* calls in such as a way that the OSGDIR
path was checked in one FIND* call, then the system directories were
called afterwards in their of FIND* call.

In the CMake CVS version of FindOpenSceneGraph is it still possible to
override the system paths or explicitly use a local version of the
OSG?

Yes.

The problem you were having was a limitation in CMake 2.4.x that many people got around by calling FIND_LIBRARY() twice, once with NO_DEFAULT_PATH and the variable in PATHS, and then the normal call. This proved very cumbersome so the HINTS option was added in 2.6.0 which is just like PATHS but it happens BEFORE searching the system paths.

The support for CMAKE_PREFIX_PATH, which was also added in 2.6.0 (both as an environment variable and as a CMake variable) supersedes HINTS. It turns out if you set CMAKE_PREFIX_PATH properly you can usually find pretty much any package in a special place without having to rely on a special environment variable or CMake variable for each one. Obviously I still like having per-package environment variables though and CMake CVS supports a wide range of possibilities, (OSG_DIR, OSGDIR, OSG_ROOT, etc.). There is even a per nodekit environment variable you can use that must have been thrown in for good measure which is obviously still supported (OSG<KIT>_DIR). Smile

The 2.6.x documentation does a good job of explaining the search process that find_library(), find_path(), and find_program() go through, if you're curious.
http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_library



--
Philip Lowman

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts OSGPL - Legal questions on version an... schuetze General 2 Mon Mar 04, 2019 3:07 pm View latest post
No new posts Setup and Start OSG library questions. Zachary1234 General 2 Sun Feb 10, 2019 11:23 pm View latest post
No new posts How make my app to load plugins marco.beninca General 1 Thu Dec 06, 2018 2:34 pm View latest post
No new posts Camera movement when depending on 3rd... njr3 General 0 Wed Nov 28, 2018 9:46 pm View latest post
No new posts Camera movement when depending on 3rd... njr3 General 0 Wed Nov 28, 2018 9:44 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP