1
0

Findosg.cmake 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. PATHS
  29. $ENV{OSG_DIR}
  30. $ENV{OSGDIR}
  31. NO_DEFAULT_PATH
  32. PATH_SUFFIXES include
  33. )
  34. FIND_PATH(OSG_INCLUDE_DIR osg/PositionAttitudeTransform
  35. PATHS
  36. ~/Library/Frameworks
  37. /Library/Frameworks
  38. /usr/local
  39. /usr
  40. /sw # Fink
  41. /opt/local # DarwinPorts
  42. /opt/csw # Blastwave
  43. /opt
  44. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
  45. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
  46. PATH_SUFFIXES include
  47. )
  48. FIND_LIBRARY(OSG_LIBRARY
  49. NAMES osg
  50. PATHS
  51. $ENV{OSG_DIR}
  52. $ENV{OSGDIR}
  53. NO_DEFAULT_PATH
  54. PATH_SUFFIXES lib64 lib
  55. )
  56. FIND_LIBRARY(OSG_LIBRARY
  57. NAMES osg
  58. PATHS
  59. ~/Library/Frameworks
  60. /Library/Frameworks
  61. /usr/local
  62. /usr
  63. /sw
  64. /opt/local
  65. /opt/csw
  66. /opt
  67. PATH_SUFFIXES lib64 lib
  68. )
  69. SET(OSG_FOUND "NO")
  70. IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
  71. SET(OSG_FOUND "YES")
  72. ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)