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