From 63ee0333cd6d885f14fcf7f7cca537d294e189b6 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Tue, 20 Oct 2009 07:55:48 -0400 Subject: [PATCH] Fixes version detection using osg/Version on Mac OSX when OSG is installed as a framework Patch from rpavlik attached to issue #9714 --- Modules/FindOpenSceneGraph.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake index b06cba46c..25cf4ee15 100644 --- a/Modules/FindOpenSceneGraph.cmake +++ b/Modules/FindOpenSceneGraph.cmake @@ -96,8 +96,14 @@ if(OSG_INCLUDE_DIR) message("[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] " "Detected OSG_INCLUDE_DIR = ${OSG_INCLUDE_DIR}") endif() - if(EXISTS "${OSG_INCLUDE_DIR}/osg/Version") - file(READ "${OSG_INCLUDE_DIR}/osg/Version" _osg_Version_contents) + + set(_osg_Version_file "${OSG_INCLUDE_DIR}/osg/Version") + if("${OSG_INCLUDE_DIR}" MATCHES "\\.framework$" AND NOT EXISTS "${_osg_Version_file}") + set(_osg_Version_file "${OSG_INCLUDE_DIR}/Headers/Version") + endif() + + if(EXISTS "${_osg_Version_file}") + file(READ "${_osg_Version_file}" _osg_Version_contents) else() set(_osg_Version_contents "unknown") endif()