summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenSceneGraph.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-20 19:42:34 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-20 19:42:34 (GMT)
commitc79dd4d951eec397692dd4af18e6a85b25a4f4ef (patch)
tree8e7cbfd9c44e410b216b18fecf331c8d50cfa922 /Modules/FindOpenSceneGraph.cmake
parent19e210af90d943548e7f07759030a2dd2cc8a2a4 (diff)
parent4be6783711b2ff510c3449c5de22d35663d8bfc1 (diff)
downloadCMake-c79dd4d951eec397692dd4af18e6a85b25a4f4ef.zip
CMake-c79dd4d951eec397692dd4af18e6a85b25a4f4ef.tar.gz
CMake-c79dd4d951eec397692dd4af18e6a85b25a4f4ef.tar.bz2
Merge topic 'read-less-from-version-headers'
4be6783 read less from version headers into variables
Diffstat (limited to 'Modules/FindOpenSceneGraph.cmake')
-rw-r--r--Modules/FindOpenSceneGraph.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 2e6774e..1f30fe3 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -107,7 +107,8 @@ if(OSG_INCLUDE_DIR)
endif()
if(EXISTS "${_osg_Version_file}")
- file(READ "${_osg_Version_file}" _osg_Version_contents)
+ file(STRINGS "${_osg_Version_file}" _osg_Version_contents
+ REGEX "#define (OSG_VERSION_[A-Z]+|OPENSCENEGRAPH_[A-Z]+_VERSION)[ \t]+[0-9]+")
else()
set(_osg_Version_contents "unknown")
endif()
@@ -134,6 +135,7 @@ if(OSG_INCLUDE_DIR)
message(WARNING "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Failed to parse version number, please report this as a bug")
endif()
+ unset(_osg_Version_contents)
set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}"
CACHE INTERNAL "The version of OSG which was detected")