Findosg.cmake 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
  36. NO_DEFAULT_PATH
  37. PATH_SUFFIXES include
  38. )
  39. FIND_PATH(OSG_INCLUDE_DIR osg/PositionAttitudeTransform
  40. PATHS
  41. ~/Library/Frameworks
  42. /Library/Frameworks
  43. /usr/local
  44. /usr
  45. /sw # Fink
  46. /opt/local # DarwinPorts
  47. /opt/csw # Blastwave
  48. /opt
  49. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
  50. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
  51. PATH_SUFFIXES include
  52. )
  53. FIND_LIBRARY(OSG_LIBRARY
  54. NAMES osg
  55. PATHS
  56. $ENV{OSG_DIR}
  57. $ENV{OSGDIR}
  58. NO_DEFAULT_PATH
  59. PATH_SUFFIXES lib64 lib
  60. )
  61. FIND_LIBRARY(OSG_LIBRARY
  62. NAMES osg
  63. PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
  64. NO_DEFAULT_PATH
  65. PATH_SUFFIXES lib64 lib
  66. )
  67. FIND_LIBRARY(OSG_LIBRARY
  68. NAMES osg
  69. PATHS
  70. ~/Library/Frameworks
  71. /Library/Frameworks
  72. /usr/local
  73. /usr
  74. /sw
  75. /opt/local
  76. /opt/csw
  77. /opt
  78. PATH_SUFFIXES lib64 lib
  79. )
  80. SET(OSG_FOUND "NO")
  81. IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
  82. SET(OSG_FOUND "YES")
  83. ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)