FindProducer.cmake 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #.rst:
  4. # FindProducer
  5. # ------------
  6. #
  7. #
  8. #
  9. # Though Producer isn't directly part of OpenSceneGraph, its primary
  10. # user is OSG so I consider this part of the Findosg* suite used to find
  11. # OpenSceneGraph components. You'll notice that I accept OSGDIR as an
  12. # environment path.
  13. #
  14. # Each component is separate and you must opt in to each module. You
  15. # must also opt into OpenGL (and OpenThreads?) as these modules won't do
  16. # it for you. This is to allow you control over your own system piece
  17. # by piece in case you need to opt out of certain components or change
  18. # the Find behavior for a particular module (perhaps because the default
  19. # FindOpenGL.cmake module doesn't work with your system as an example).
  20. # If you want to use a more convenient module that includes everything,
  21. # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake
  22. # modules.
  23. #
  24. # Locate Producer This module defines PRODUCER_LIBRARY PRODUCER_FOUND,
  25. # if false, do not try to link to Producer PRODUCER_INCLUDE_DIR, where
  26. # to find the headers
  27. #
  28. # $PRODUCER_DIR is an environment variable that would correspond to the
  29. # ./configure --prefix=$PRODUCER_DIR used in building osg.
  30. #
  31. # Created by Eric Wing.
  32. # Header files are presumed to be included like
  33. # #include <Producer/CameraGroup>
  34. # Try the user's environment request before anything else.
  35. find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
  36. HINTS
  37. ENV PRODUCER_DIR
  38. ENV OSG_DIR
  39. ENV OSGDIR
  40. PATH_SUFFIXES include
  41. PATHS
  42. ~/Library/Frameworks
  43. /Library/Frameworks
  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. HINTS
  54. ENV PRODUCER_DIR
  55. ENV OSG_DIR
  56. ENV OSGDIR
  57. PATH_SUFFIXES lib
  58. PATHS
  59. /sw
  60. /opt/local
  61. /opt/csw
  62. /opt
  63. )
  64. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  65. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Producer DEFAULT_MSG
  66. PRODUCER_LIBRARY PRODUCER_INCLUDE_DIR)