cmake

Started by
2 comments, last by jjd 10 years, 3 months ago

Hi

with:

cmake ../simgear -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/media/DATA/FGFS/install/osgearth/include"

I get:

[ 75%] Building CXX object simgear/CMakeFiles/SimGearScene.dir/scene/tgdb/ReaderWriterSTG.cxx.o
In file included from /media/DATA/FGFS/simgear/simgear/scene/tgdb/ReaderWriterSTG.cxx:51:0:
/media/DATA/FGFS/simgear/simgear/scene/util/OsgEarthLoadKML.hxx:31:28: fatal error: osgEarth/IOTypes: No such file or directory
compilation terminated.
make[2]: *** [simgear/CMakeFiles/SimGearScene.dir/scene/tgdb/ReaderWriterSTG.cxx.o] Error 1
make[1]: *** [simgear/CMakeFiles/SimGearScene.dir/all] Error 2
make: *** [all] Error 2
michael@michael-Ubuntu:/media/DATA/FGFS/simgearbuild$

IOTypes are in:

/media/DATA/FGFS/install/osgearth/include

What am I doing wrong/need to change?

Many thanks

Advertisement

First, this is a build error so it is not exactly cmake that is failing.

Here is what I did to see what was going on. I clone the latest code from gitorious to

/repos/simgear

I prefer having the build directory in the repo but out of the source (many projects have build/* in their .gitignore for that reason). So I have,

/repos/simgear/build

From there I ran

$ cmake .. -DCMAKE_BUILD_TYPE=Release

I didn't add the CMAKE_PREFIX_PATH because that did not seem to make sense. The CMAKE_PREFIX_PATH is used to help cmake find things (libraries, headers, etc) using the cmake find_* functions. It is not the normal way of including headers from your own project and doens't work that way. Is that what you anticipated? Anyway, cmake worked so I build the code with make. It worked.

Since I didn't use the CMAKE_PREFIX_PATH and it worked I thought I would retry cmake again with CMAKE_PREFIX_PATH to see if there was some odd interaction going on. I actually used,

$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/media/DATA/FGFS/install/osgearth/include"

using your path, but since cmake could find everything it needed it did not seem to care. Again, the build succeeded.

My conclusion at this point is that you have done something to the structure of the project that is irregular. Have you restructured it? Maybe moved the directories after using cmake?

-Josh

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet

Thanks yes I also had a older osgearth installed. After remving this with synaptic I now get:

[ 75%] Building CXX object simgear/CMakeFiles/SimGearScene.dir/scene/tgdb/ReaderWriterSTG.cxx.o
In file included from /media/DATA/FGFS/simgear/simgear/scene/tgdb/ReaderWriterSTG.cxx:51:0:
/media/DATA/FGFS/simgear/simgear/scene/util/OsgEarthLoadKML.hxx:30:28: fatal error: osgEarth/MapNode: No such file or directory
compilation terminated.
make[2]: *** [simgear/CMakeFiles/SimGearScene.dir/scene/tgdb/ReaderWriterSTG.cxx.o] Error 1
make[1]: *** [simgear/CMakeFiles/SimGearScene.dir/all] Error 2
make: *** [all] Error 2
michael@michael-Ubuntu:/media/DATA/FGFS/simgear/build$

but it's here:

michael@michael-Ubuntu:/media/DATA/FGFS/install/osgearth/include/osgEarth$ ls MapNo*
MapNode MapNodeObserver MapNodeOptions

the command was:

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/media/DATA/FGFS/install/osgearth;/media/DATA/FGFS/install/osgearth/include" -DCMAKE_INSTALL_PREFIX=/media/DATA/FGFS/install/simgear

Thanks again and merry christmas

PS:

michael@michael-Ubuntu:/media/DATA/FGFS/simgear/build$ cmake ../simgear -L
CMake Error: The source "/media/DATA/FGFS/simgear/simgear/CMakeLists.txt" does not match the source "/media/DATA/FGFS/simgear/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
-- Cache values
BUILD_TESTING:BOOL=ON
Boost_DIR:PATH=Boost_DIR-NOTFOUND
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_DEBUG_POSTFIX:STRING=d
CMAKE_INSTALL_PREFIX:PATH=/media/DATA/FGFS/install/simgear
CMAKE_MINSIZEREL_POSTFIX:STRING=
CMAKE_RELEASE_POSTFIX:STRING=
CMAKE_RELWITHDEBINFO_POSTFIX:STRING=
ENABLE_OSGEARTH:BOOL=ON
ENABLE_PKGUTIL:BOOL=ON
ENABLE_RTI:BOOL=OFF
ENABLE_SOUND:BOOL=ON
ENABLE_TESTS:BOOL=ON
JPEG_FACTORY:BOOL=OFF
MSVC_3RDPARTY_ROOT:PATH=NOT_FOUND
OPENTHREADS_INCLUDE_DIR:PATH=/usr/include
OPENTHREADS_LIBRARY:FILEPATH=/usr/lib/libOpenThreads.so
OPENTHREADS_LIBRARY_DEBUG:FILEPATH=OPENTHREADS_LIBRARY_DEBUG-NOTFOUND
OSGDB_INCLUDE_DIR:PATH=/usr/include
OSGDB_LIBRARY:FILEPATH=/usr/lib/libosgDB.so
OSGDB_LIBRARY_DEBUG:FILEPATH=OSGDB_LIBRARY_DEBUG-NOTFOUND
OSGEARTHANNOTATION_LIBRARY:FILEPATH=/media/DATA/FGFS/install/osgearth/lib64/libosgEarthAnnotation.so
OSGEARTHFEATURES_LIBRARY:FILEPATH=/media/DATA/FGFS/install/osgearth/lib64/libosgEarthFeatures.so
OSGEARTHSYMBOLOGY_LIBRARY:FILEPATH=/media/DATA/FGFS/install/osgearth/lib64/libosgEarthSymbology.so
OSGEARTHUTIL_LIBRARY:FILEPATH=/media/DATA/FGFS/install/osgearth/lib64/libosgEarthUtil.so
OSGEARTH_INCLUDE_DIR:PATH=/media/DATA/FGFS/install/osgearth/include
OSGEARTH_LIBRARY:FILEPATH=/media/DATA/FGFS/install/osgearth/lib64/libosgEarth.so
OSGGA_INCLUDE_DIR:PATH=/usr/include
OSGGA_LIBRARY:FILEPATH=/usr/lib/libosgGA.so
OSGGA_LIBRARY_DEBUG:FILEPATH=OSGGA_LIBRARY_DEBUG-NOTFOUND
OSGPARTICLE_INCLUDE_DIR:PATH=/usr/include
OSGPARTICLE_LIBRARY:FILEPATH=/usr/lib/libosgParticle.so
OSGPARTICLE_LIBRARY_DEBUG:FILEPATH=OSGPARTICLE_LIBRARY_DEBUG-NOTFOUND
OSGSIM_INCLUDE_DIR:PATH=/usr/include
OSGSIM_LIBRARY:FILEPATH=/usr/lib/libosgSim.so
OSGSIM_LIBRARY_DEBUG:FILEPATH=OSGSIM_LIBRARY_DEBUG-NOTFOUND
OSGTEXT_INCLUDE_DIR:PATH=/usr/include
OSGTEXT_LIBRARY:FILEPATH=/usr/lib/libosgText.so
OSGTEXT_LIBRARY_DEBUG:FILEPATH=OSGTEXT_LIBRARY_DEBUG-NOTFOUND
OSGUTIL_INCLUDE_DIR:PATH=/usr/include
OSGUTIL_LIBRARY:FILEPATH=/usr/lib/libosgUtil.so
OSGUTIL_LIBRARY_DEBUG:FILEPATH=OSGUTIL_LIBRARY_DEBUG-NOTFOUND
OSG_INCLUDE_DIR:PATH=/usr/include
OSG_LIBRARY:FILEPATH=/usr/lib/libosg.so
OSG_LIBRARY_DEBUG:FILEPATH=OSG_LIBRARY_DEBUG-NOTFOUND
SIMGEAR_HEADLESS:BOOL=OFF
SIMGEAR_SHARED:BOOL=OFF
SYSTEM_EXPAT:BOOL=OFF
michael@michael-Ubuntu:/media/DATA/FGFS/simgear/build$

Oh man, I was confused! I thought that osgearth (read as osGEARth) was a part of simgear and couldn't understand why you were including simgear headers from outside the source tree... Anyway, you are going to want to address that error that cmake is reporting -- blow away the build directory and re-run cmake. Next, where does OsgEarthLoadKML.hxx come from? It is not in the simgear repository that I cloned.

-Josh

P.S. where did you get simgear from? Maybe I am using the wrong repository?

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet

This topic is closed to new replies.

Advertisement