diff options
Diffstat (limited to 'Modules/FindosgSim.cmake')
-rw-r--r-- | Modules/FindosgSim.cmake | 58 |
1 files changed, 13 insertions, 45 deletions
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake index 1293af7..485b5af 100644 --- a/Modules/FindosgSim.cmake +++ b/Modules/FindosgSim.cmake @@ -11,9 +11,13 @@ # # Locate osgSim # This module defines -# OSGSIM_LIBRARY -# OSGSIM_FOUND, if false, do not try to link to osgSim -# OSGSIM_INCLUDE_DIR, where to find the headers +# +# OSGSIM_FOUND - Was osgSim found? +# OSGSIM_INCLUDE_DIR - Where to find the headers +# OSGSIM_LIBRARIES - The libraries to link for osgSim (use this) +# +# OSGSIM_LIBRARY - The osgSim library +# OSGSIM_LIBRARY_DEBUG - The osgSim debug library # # $OSGDIR is an environment variable that would # correspond to the ./configure --prefix=$OSGDIR @@ -25,46 +29,10 @@ # #include <osg/PositionAttitudeTransform> # #include <osgSim/ImpostorSprite> -# Try the user's environment request before anything else. -FIND_PATH(OSGSIM_INCLUDE_DIR osgSim/ImpostorSprite - HINTS - $ENV{OSGSIM_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(OSGSIM_LIBRARY - NAMES osgSim - HINTS - $ENV{OSGSIM_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(OSGSIM_FOUND "NO") -IF(OSGSIM_LIBRARY AND OSGSIM_INCLUDE_DIR) - SET(OSGSIM_FOUND "YES") -ENDIF(OSGSIM_LIBRARY AND OSGSIM_INCLUDE_DIR) +include(Findosg_functions) +OSG_FIND_PATH (OSGSIM osgSim/ImpostorSprite) +OSG_FIND_LIBRARY(OSGSIM osgSim) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSGSIM DEFAULT_MSG + OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR) |