summaryrefslogtreecommitdiff
path: root/Modules/FindosgDB.cmake
diff options
context:
space:
mode:
authorPhilip Lowman <philip@yhbt.com>2009-01-19 13:33:36 -0500
committerPhilip Lowman <philip@yhbt.com>2009-01-19 13:33:36 -0500
commitd1640b11def5076223a87680adb6341b1dbd2c10 (patch)
tree558e9c82969d7aa589bd0cebbf2e11a45aa25358 /Modules/FindosgDB.cmake
parentd69e68609c29c14b3a88e2539d12940c04afb32b (diff)
downloadcmake-d1640b11def5076223a87680adb6341b1dbd2c10.tar.gz
BUG: Fixed Issue #7331 Bugs in Findosg*.cmake. Also added OPENTHREADS_LIBRARIES.
Diffstat (limited to 'Modules/FindosgDB.cmake')
-rw-r--r--Modules/FindosgDB.cmake58
1 files changed, 13 insertions, 45 deletions
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index 88da80761a..da670af30c 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -11,9 +11,13 @@
#
# Locate osgDB
# This module defines
-# OSGDB_LIBRARY
-# OSGDB_FOUND, if false, do not try to link to osgDB
-# OSGDB_INCLUDE_DIR, where to find the headers
+#
+# OSGDB_FOUND - Was osgDB found?
+# OSGDB_INCLUDE_DIR - Where to find the headers
+# OSGDB_LIBRARIES - The libraries to link against for the osgDB (use this)
+#
+# OSGDB_LIBRARY - The osgDB library
+# OSGDB_LIBRARY_DEBUG - The osgDB debug library
#
# $OSGDIR is an environment variable that would
# correspond to the ./configure --prefix=$OSGDIR
@@ -25,46 +29,10 @@
# #include <osg/PositionAttitudeTransform>
# #include <osgDB/DatabasePager>
-# Try the user's environment request before anything else.
-FIND_PATH(OSGDB_INCLUDE_DIR osgDB/DatabasePager
- HINTS
- $ENV{OSGDB_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- PATH_SUFFIXES include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local
- /usr
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
- [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
- [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
-)
-
-FIND_LIBRARY(OSGDB_LIBRARY
- NAMES osgDB
- HINTS
- $ENV{OSGDB_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local
- /usr
- /sw
- /opt/local
- /opt/csw
- /opt
-)
-
-SET(OSGDB_FOUND "NO")
-IF(OSGDB_LIBRARY AND OSGDB_INCLUDE_DIR)
- SET(OSGDB_FOUND "YES")
-ENDIF(OSGDB_LIBRARY AND OSGDB_INCLUDE_DIR)
+include(Findosg_functions)
+OSG_FIND_PATH (OSGDB osgDB/DatabasePager)
+OSG_FIND_LIBRARY(OSGDB osgDB)
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSGDB DEFAULT_MSG
+ OSGDB_LIBRARY OSGDB_INCLUDE_DIR)