Findosg.cmake 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # This is part of the Findosg* suite used to find OpenSceneGraph components.
  2. # Each component is separate and you must opt in to each module. You must
  3. # also opt into OpenGL and OpenThreads (and Producer if needed) as these
  4. # modules won't do it for you. This is to allow you control over your own
  5. # system piece by piece in case you need to opt out of certain components
  6. # or change the Find behavior for a particular module (perhaps because the
  7. # default FindOpenGL.cmake module doesn't work with your system as an
  8. # example).
  9. # If you want to use a more convenient module that includes everything,
  10. # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
  11. #
  12. # Locate osg
  13. # This module defines
  14. # OSG_LIBRARY
  15. # OSG_FOUND, if false, do not try to link to osg
  16. # OSG_INCLUDE_DIR, where to find the headers
  17. #
  18. # $OSGDIR is an environment variable that would
  19. # correspond to the ./configure --prefix=$OSGDIR
  20. # used in building osg.
  21. #
  22. # Created by Eric Wing.
  23. # Header files are presumed to be included like
  24. # #include <osg/PositionAttitudeTransform>
  25. # #include <osgUtil/SceneView>
  26. # Try the user's environment request before anything else.
  27. FIND_PATH(OSG_INCLUDE_DIR osg/PositionAttitudeTransform
  28. HINTS
  29. $ENV{OSG_DIR}
  30. $ENV{OSGDIR}
  31. PATH_SUFFIXES include
  32. PATHS
  33. ~/Library/Frameworks
  34. /Library/Frameworks
  35. /usr/local
  36. /usr
  37. /sw # Fink
  38. /opt/local # DarwinPorts
  39. /opt/csw # Blastwave
  40. /opt
  41. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
  42. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
  43. )
  44. FIND_LIBRARY(OSG_LIBRARY
  45. NAMES osg
  46. HINTS
  47. $ENV{OSG_DIR}
  48. $ENV{OSGDIR}
  49. PATH_SUFFIXES lib64 lib
  50. PATHS
  51. ~/Library/Frameworks
  52. /Library/Frameworks
  53. /usr/local
  54. /usr
  55. /sw
  56. /opt/local
  57. /opt/csw
  58. /opt
  59. )
  60. SET(OSG_FOUND "NO")
  61. IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
  62. SET(OSG_FOUND "YES")
  63. ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)