Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit fe8da5a9 authored by Bill Hoffman's avatar Bill Hoffman

Try to fix bug#9714, should not crash when version file is not where it should be...

parent 847918b3
......@@ -96,13 +96,16 @@ if(OSG_INCLUDE_DIR)
message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}")
endif()
file(READ "${OSG_INCLUDE_DIR}/osg/Version" _osg_Version_contents)
if(EXISTS "${OSG_INCLUDE_DIR}/osg/Version")
file(READ "${OSG_INCLUDE_DIR}/osg/Version" _osg_Version_contents)
else()
set(_osg_Version_contents "unknown")
endif()
string(REGEX MATCH ".*#define OSG_VERSION_MAJOR[ \t]+[0-9]+.*"
_osg_old_defines ${_osg_Version_contents})
_osg_old_defines "${_osg_Version_contents}")
string(REGEX MATCH ".*#define OPENSCENEGRAPH_MAJOR_VERSION[ \t]+[0-9]+.*"
_osg_new_defines ${_osg_Version_contents})
_osg_new_defines "${_osg_Version_contents}")
if(_osg_old_defines)
string(REGEX REPLACE ".*#define OSG_VERSION_MAJOR[ \t]+([0-9]+).*"
"\\1" _osg_VERSION_MAJOR ${_osg_Version_contents})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment