Reputation: 444
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".
Upvotes: 1
Views: 3229
Reputation: 51
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
Upvotes: 3