Hi Thomas, you need to do a couple of things, first take a copy of the CMakeModules folder of OSG itself : http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/CMakeModules
Then you need to tell CMake via your CMakeLists.txt where to find those set(CMAKE_MODULE_PATH "PATH_TO/CMakeModules;${CMAKE_MODULE_PATH}") # this will include and run CMakeModules/FindXXX.cmake find_package(OpenThreads) find_package(OSG) include_directories(${OSG_INCLUDE_DIR}) project(testProject) add_executable(testProjectMain main.cpp ) target_link_libraries(testProjectMain ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY}) HTH -- Mathieu O< ascii ribbon campaign - stop html mail - www.asciiribbon.org 2009/10/26 Thomas Maier <in...@web.de>: > Hi, > > i used the source code on this site > http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/BasicGeometry, > then i build test-src/ and test-build/ directories. Into test-src/ dir i put > in the file main.cpp with the example code. Then i created a CMakeLists.txt > file and put into it: > PROJECT(testProject) > ADD_EXECUTABLE(testProjectMain > main.cpp > ) > > then i switched into test-build/ dir and run "ccmake ../test-src/" then i run > "make" and the output is: > Linking CXX executable /tmp/testProjectMain > /usr/bin/cmake -E cmake_link_script CMakeFiles/testProjectMain.dir/link.txt > --verbose=1 > /usr/bin/c++ -g CMakeFiles/testProjectMain.dir/main.o -o > /tmp/testProjectMain -rdynamic > CMakeFiles/testProjectMain.dir/main.o: In function `main': > /home/bob/openscenegraph-programming/test/test-src/main.cpp:27: undefined > reference to `osgViewer::Viewer::Viewer()' > /home/bob/openscenegraph-programming/test/test-src/main.cpp:28: undefined > reference to `osg::Group::Group()' > > > How can i let cmake know that it should use osg header/libs? Is there > anywhere online a tutorial which explains the building of e.g. the examples? > i did not find anything,sorry. > > thanks for help > flo > > > > > Thank you! > > Cheers, > inflo > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=18735#18735 > > > > > > _______________________________________________ > 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