forked from Eyescale/CMake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OSG.cmake
32 lines (24 loc) · 1.15 KB
/
OSG.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) 2013-2014, EPFL/Blue Brain Project
# jhernando@fi.upm.es
# This script finds the ABI version of a previously detected OpenSceneGraph
# installation and exports the following variables:
#
# OPENSCENEGRAPH_SOVERSION - The ABI version parsed from osg/Version
# OPENSCENEGRAPH_DEB_DEPENDENCIES - The .deb package name compatible with the
# found version
if(NOT OPENSCENEGRAPH_FOUND)
return()
endif()
set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version")
if(NOT EXISTS "${_osg_Version_file}")
message(SEND_ERROR
"OpenSceneGraph version header file not found: ${_osg_Version_file}")
return()
endif()
file(STRINGS "${_osg_Version_file}" _osg_Version_contents
REGEX "#define (OPENSCENEGRAPH_SOVERSION)[ \t]+[0-9]+")
string(REGEX REPLACE ".*#define OPENSCENEGRAPH_SOVERSION[ \t]+([0-9]+).*"
"\\1" _osg_SOVERSION ${_osg_Version_contents})
set(OPENSCENEGRAPH_SOVERSION ${_osg_SOVERSION})
set(OPENSCENEGRAPH_DEB_DEPENDENCIES "libopenscenegraph${_osg_SOVERSION} (>= ${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR})"
CACHE INTERNAL "The binary debian package of the OSG version which was detected")