1

Well,I am new to CMake and want to edit flight simulation code in eclipse instead of visual studio. For that purpose, I downloaded the source code of Simgear, CMake, Boost libraries, open scene graph and openalsoft.

Now I have all the data available but I dont know where to place some of these libraries. As a result, when I run CMake and give reference to my flightgear code, it complains that the openscenegraph libraries are not installed.

Please help me with where I need to put all these files so as to convert my code to eclipse using CMake. I have already installed boost and openal libraries. Only issue is of openscenegraph libraries which I put in program files at the following path "C:\Program Files\OpenSceneGraph-3.4.0" but CMake can't access it. The error code is

Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
version is 2016 dot 3 dot 1
ignoring: ^C:/Media/Project/study material/flight gear/simgear-2016.3.1/.git;\\.gitignore;Makefile.am;~$;
Library installation directory: lib
Boost version: 1.62.0
SimGear mode: NORMAL
Found OpenAL: C:/Program Files/OpenAL/OpenAL32.lib  
Sound support: ENABLED
Could NOT find osgText (missing:  OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR) 
Could NOT find osgSim (missing:  OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR) 
Could NOT find osgDB (missing:  OSGDB_LIBRARY OSGDB_INCLUDE_DIR) 
Could NOT find osgParticle (missing:  OSGPARTICLE_LIBRARY OSGPARTICLE_INCLUDE_DIR) 
Could NOT find osgGA (missing:  OSGGA_LIBRARY OSGGA_INCLUDE_DIR) 
Could NOT find osgViewer (missing:  OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR) 
Could NOT find osgUtil (missing:  OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR) 
Could NOT find osg (missing:  OSG_LIBRARY OSG_INCLUDE_DIR) 
Could NOT find OpenThreads (missing:  OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR) 
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find OpenSceneGraph (missing: OPENSCENEGRAPH_LIBRARIES
  OPENSCENEGRAPH_INCLUDE_DIR OSGTEXT_FOUND OSGSIM_FOUND OSGDB_FOUND
  OSGPARTICLE_FOUND OSGGA_FOUND OSGVIEWER_FOUND OSGUTIL_FOUND OSG_FOUND
  OPENTHREADS_FOUND) (Required is at least version "3.2.0")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.7/Modules/FindOpenSceneGraph.cmake:223 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:243 (find_package)


Configuring incomplete, errors occurred!
See also "C:/Users/shajeeh/Documents/CMake/CMakeFiles/CMakeOutput.log".
MSM
  • 410
  • 6
  • 16
  • Duplicate of [Compilation of flightgear code in eclipse using cmake](http://stackoverflow.com/questions/40373379/compilation-of-flightgear-code-in-eclipse-using-cmake) – rocambille Nov 07 '16 at 09:28
  • What **approach** do you use for find OpenAL library [in that question](http://stackoverflow.com/questions/40373379/compilation-of-flightgear-code-in-eclipse-using-cmake)? Have you tried (and how) this approach for OSG library? There are many libraries used for development under CMake, and having distinct questions for **every** library ... it is not a purpose of Stack Overflow. – Tsyvarev Nov 07 '16 at 09:29
  • I entered a code snippet in the Findopenal.cmake to address to the location of my libraries and that did work. I tried to do the same for findopenscenegraph.cmake but it gave errors as ......Could not find a package configuration file provided by "C:/Program Files/OpenSceneGraph-3.4.0/build" with any of the following names: C:/Program Files/OpenSceneGraph-3.4.0/buildConfig.cmake c:/program files/openscenegraph-3.4.0/build-config.cmake – MSM Nov 07 '16 at 10:21
  • @wasthishelpful yes it is the same question but there were no more any comments comming so thought that the question may be outdated so i posted a new one.. I'll be very grateful If you please tell me how to configure this openscenegrah. – MSM Nov 07 '16 at 10:27
  • `Only issue is of openscenegraph libraries which I put in program files at the following path "C:\Program Files\OpenSceneGraph-3.4.0"` - Do you **manually** copy some files (which ones?) into given directory? This is not an usual way for installing things. Why do not follow official guide for install OSC, e.g. [this one](https://github.com/openscenegraph/OpenSceneGraph/blob/master/README.md)? **Modification** of `FindXXX.cmake`, as you did for find `OpenAL` library, is also uncommon: instead, you need to set environment/CMake variables for hint library location. – Tsyvarev Nov 07 '16 at 10:43

1 Answers1

3

I'm not a CMake expert, here some things I did in order to create ROS & OSG project in Linux:

add an environment variable (if it is not there yet) to the .bashrc file:

export PATH=${PATH}: .../OpenSceneGraph-3.4.0/bin (your absolute path)

then in CMake file add:

FIND_PACKAGE ( OpenSceneGraph COMPONENTS osgSim osgUtil osgDB osgFX osgGA osgTerrain osgViewer osgText osgWidget osgManipulator osg osgShadow)

target_link_libraries(name_of_your_executable ${PROJECT_NAME} ${OPENSCENEGRAPH_LIBRARIES})

For more information check CMake documentation here and here

Etimr
  • 51
  • 6