summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Lowman <philip@yhbt.com>2009-10-20 11:55:48 (GMT)
committerPhilip Lowman <philip@yhbt.com>2009-10-20 11:55:48 (GMT)
commit63ee0333cd6d885f14fcf7f7cca537d294e189b6 (patch)
tree060dbd0aa36d13647c65577e385a9a1dea6d1e71
parentc6a4dce3f40a36198c721cb6f4848c26230d5697 (diff)
downloadCMake-63ee0333cd6d885f14fcf7f7cca537d294e189b6.zip
CMake-63ee0333cd6d885f14fcf7f7cca537d294e189b6.tar.gz
CMake-63ee0333cd6d885f14fcf7f7cca537d294e189b6.tar.bz2
Fixes version detection using osg/Version on Mac OSX when OSG is installed as a framework
Patch from rpavlik attached to issue #9714
-rw-r--r--Modules/FindOpenSceneGraph.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index b06cba4..25cf4ee 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()