Hi Lawrenece,

The CMake Findosg.cmake etc. scripts use the OSGDIR environmental
variable as one of the paths it checks for where the OSG libs/headers
are, so just set this to ~/OpenSceneGraph-3.0.1-build-eclipse-cdt and
then remove the CMakeCache.txt and then re-run cmake to build the
makefiles.  Alternatively you can set the paths using cmake using
ccmake.

Robert.

On 19 April 2012 03:54, Lawrence Tsang <[email protected]> wrote:
> Hi,
>
>      I have just downloaded the OpenSceneGraph source, unzip it into
> "~/OpenSceneGraph-3.0.1" directory and use CMake to create an out-of-source
> eclipse make project in "~/OpenSceneGraph-3.0.1-build-eclipse-cdt"
> directory. When I execute "make" in
> "~/OpenSceneGraph-3.0.1-build-eclipse-cdt" directory, OpenSceneGraph builds
> successfully. I have not run "sudo make install" as I do not want to install
> OpenSceneGraph tightly into my Ubuntu system.
>
>      Now I want to use CMake to create a project using the compiled
> OpenSceneGraph libraries. I use the following codes in CMakeLists.txt :
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> PROJECT( test_proj )
> FIND_PACKAGE(OpenSceneGraph)
> ADD_EXECUTABLE( test test.cpp )
> INCLUDE_DIRECTORIES(${OPENSCENEGRAPH_INCLUDE_DIRS})
> TARGET_LINK_LIBRARIES( test ${OPENSCENEGRAPH_LIBRARIES} )
>
>      But it seems that OpenSceneGraph could not be found by CMake.
>
>      Does anyone know how CMake could find the compiled OpenSceneGraph
> libraries in the "~/OpenSceneGraph-3.0.1-build-eclipse-cdt" directory and
> use it to create projects as if I have tightly installed OpenSceneGraph
> using "sudo make install". Thanks for any suggestion.
>
> Lawrence
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to