FindProducer.cmake 2.3 KB

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