summaryrefslogtreecommitdiffstats
path: root/Modules/FindosgShadow.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindosgShadow.cmake')
-rw-r--r--Modules/FindosgShadow.cmake58
1 files changed, 13 insertions, 45 deletions
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index ddb59fb..f74561a 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -11,9 +11,13 @@
#
# Locate osgShadow
# This module defines
-# OSGSHADOW_LIBRARY
-# OSGSHADOW_FOUND, if false, do not try to link to osgShadow
-# OSGSHADOW_INCLUDE_DIR, where to find the headers
+#
+# OSGSHADOW_FOUND - Was osgShadow found?
+# OSGSHADOW_INCLUDE_DIR - Where to find the headers
+# OSGSHADOW_LIBRARIES - The libraries to link for osgShadow (use this)
+#
+# OSGSHADOW_LIBRARY - The osgShadow library
+# OSGSHADOW_LIBRARY_DEBUG - The osgShadow debug library
#
# $OSGDIR is an environment variable that would
# correspond to the ./configure --prefix=$OSGDIR
@@ -25,46 +29,10 @@
# #include <osg/PositionAttitudeTransform>
# #include <osgShadow/ShadowTexture>
-# Try the user's environment request before anything else.
-FIND_PATH(OSGSHADOW_INCLUDE_DIR osgShadow/ShadowTexture
- HINTS
- $ENV{OSGSHADOW_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(OSGSHADOW_LIBRARY
- NAMES osgShadow
- HINTS
- $ENV{OSGSHADOW_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(OSGSHADOW_FOUND "NO")
-IF(OSGSHADOW_LIBRARY AND OSGSHADOW_INCLUDE_DIR)
- SET(OSGSHADOW_FOUND "YES")
-ENDIF(OSGSHADOW_LIBRARY AND OSGSHADOW_INCLUDE_DIR)
+include(Findosg_functions)
+OSG_FIND_PATH (OSGSHADOW osgShadow/ShadowTexture)
+OSG_FIND_LIBRARY(OSGSHADOW osgShadow)
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSGSHADOW DEFAULT_MSG
+ OSGSHADOW_LIBRARY OSGSHADOW_INCLUDE_DIR)