FindosgSim.cmake 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 osgSim
  13. # This module defines
  14. # OSGSIM_LIBRARY
  15. # OSGSIM_FOUND, if false, do not try to link to osgSim
  16. # OSGSIM_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 <osgSim/ImpostorSprite>
  26. # Try the user's environment request before anything else.
  27. FIND_PATH(OSGSIM_INCLUDE_DIR osgSim/ImpostorSprite
  28. PATHS
  29. $ENV{OSGSIM_DIR}
  30. $ENV{OSG_DIR}
  31. $ENV{OSGDIR}
  32. NO_DEFAULT_PATH
  33. PATH_SUFFIXES include
  34. )
  35. FIND_PATH(OSGSIM_INCLUDE_DIR osgSim/ImpostorSprite
  36. PATHS
  37. ~/Library/Frameworks
  38. /Library/Frameworks
  39. /usr/local
  40. /usr
  41. /sw # Fink
  42. /opt/local # DarwinPorts
  43. /opt/csw # Blastwave
  44. /opt
  45. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
  46. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
  47. PATH_SUFFIXES include
  48. )
  49. FIND_LIBRARY(OSGSIM_LIBRARY
  50. NAMES osgSim
  51. PATHS
  52. $ENV{OSGSIM_DIR}
  53. $ENV{OSG_DIR}
  54. $ENV{OSGDIR}
  55. NO_DEFAULT_PATH
  56. PATH_SUFFIXES lib64 lib
  57. )
  58. FIND_LIBRARY(OSGSIM_LIBRARY
  59. NAMES osgSim
  60. PATHS
  61. ~/Library/Frameworks
  62. /Library/Frameworks
  63. /usr/local
  64. /usr
  65. /sw
  66. /opt/local
  67. /opt/csw
  68. /opt
  69. PATH_SUFFIXES lib64 lib
  70. )
  71. SET(OSGSIM_FOUND "NO")
  72. IF(OSGSIM_LIBRARY AND OSGSIM_INCLUDE_DIR)
  73. SET(OSGSIM_FOUND "YES")
  74. ENDIF(OSGSIM_LIBRARY AND OSGSIM_INCLUDE_DIR)