The release of CMake 2.6.3 includes a new find module which makes using the
OSG from within a project of your own much easier to do.  There is also
version support available should you want to specify the minimum (or exact)
version of the OSG that is needed to build your project.

Here's a 6 line hello world example.  Replace "foo.cpp" with the OSG app of
your choice and modify the find_package() line to contain the list of
nodekits/libraries you require.

CMakeLists.txt:
=================
project(Foo)
cmake_minimum_required(VERSION 2.6.3)

find_package(OpenSceneGraph 2.8.0 REQUIRED osgUtil osgDB
osgWhateverNodekitsYouNeed)

include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
add_executable(foo foo.cpp)
target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
==================

If you need to set cmake_minimum_required to less than 2.6.3 please see the
documentation for FindOpenSceneGraph.cmake as you will need to copy a few
files from the 2.6.3 release of CMake into your CMake module path.

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

Reply via email to