mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Merge topic 'read-less-from-version-headers'
4be6783 read less from version headers into variables
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user