[CMake] Corrupted CmakeLists.txt File how to heal it ?

Nils Gladitz nilsgladitz at gmail.com
Tue Sep 9 08:18:38 EDT 2014


On 09/09/2014 02:05 PM, Sonya Blade wrote:
> Hi Nils,
> You guess is correct it is not top level CMakeLists.txt, but actually
> originator instruct to do so
> and even instruct to add the additional lines to sub-level
> CMakeLists.txt. Probably I misinterpreted it,
> and probably this is what he meant:
> "Add the additional lines to the sub level CmakeLists but run the
> top-level Cmakelists file".
>
> In in case modifying the auto generated code sounds weird to me, as a
> more experienced user than me
> do you spot any abnormalities by runing a quick eye at the code below ?
>
> Originator Quote (OSG Cookbook)
> {
> /When we have the CMakeLists.txt file in the project folder (in projects//
> /osgWeb), open it with any text editor and modify the last few lines:/
> /
> /
> /find_path( OPENSCENEGRAPH_ROOT include/osg/Node PATHS/
> /$ENV{OSG_ROOT} )/
> /include_directories( ${OPENSCENEGRAPH_ROOT}/include )/
> /link_directories( ${Boost_LIBRARY_DIRS}/
> /${OPENSCENEGRAPH_ROOT}/lib )/
> /include_platform()/
> /target_link_libraries(${PROJECT_NAME} OpenThreads/
> /osg osgDB osgGA osgViewer)/
> }

If the issue is with the generator you might want to bring this up with 
the project maintainers.

Generated CMake projects are a bit of an oddity given that most CMake 
projects are handwritten and CMake itself does not provide the 
facilities used for the generation.

Nils



More information about the CMake mailing list