FindProducer.cmake 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. Though Producer isn't directly part of OpenSceneGraph, its primary
  7. user is OSG so I consider this part of the Findosg* suite used to find
  8. OpenSceneGraph components. You'll notice that I accept OSGDIR as an
  9. environment path.
  10. Each component is separate and you must opt in to each module. You
  11. must also opt into OpenGL (and OpenThreads?) as these modules won't do
  12. it for you. This is to allow you control over your own system piece
  13. by piece in case you need to opt out of certain components or change
  14. the Find behavior for a particular module (perhaps because the default
  15. FindOpenGL.cmake module doesn't work with your system as an example).
  16. If you want to use a more convenient module that includes everything,
  17. use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake
  18. modules.
  19. Locate Producer This module defines PRODUCER_LIBRARY PRODUCER_FOUND,
  20. if false, do not try to link to Producer PRODUCER_INCLUDE_DIR, where
  21. to find the headers
  22. $PRODUCER_DIR is an environment variable that would correspond to the
  23. ./configure --prefix=$PRODUCER_DIR used in building osg.
  24. Created by Eric Wing.
  25. #]=======================================================================]
  26. # Header files are presumed to be included like
  27. # #include <Producer/CameraGroup>
  28. # Try the user's environment request before anything else.
  29. find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
  30. HINTS
  31. ENV PRODUCER_DIR
  32. ENV OSG_DIR
  33. ENV OSGDIR
  34. PATH_SUFFIXES include
  35. PATHS
  36. ~/Library/Frameworks
  37. /Library/Frameworks
  38. /opt
  39. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]
  40. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]
  41. )
  42. find_library(PRODUCER_LIBRARY
  43. NAMES Producer
  44. HINTS
  45. ENV PRODUCER_DIR
  46. ENV OSG_DIR
  47. ENV OSGDIR
  48. PATH_SUFFIXES lib
  49. PATHS
  50. /opt
  51. )
  52. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  53. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Producer DEFAULT_MSG
  54. PRODUCER_LIBRARY PRODUCER_INCLUDE_DIR)