FindProducer.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #.rst:
  2. # FindProducer
  3. # ------------
  4. #
  5. #
  6. #
  7. # Though Producer isn't directly part of OpenSceneGraph, its primary
  8. # user is OSG so I consider this part of the Findosg* suite used to find
  9. # OpenSceneGraph components. You'll notice that I accept OSGDIR as an
  10. # environment path.
  11. #
  12. # Each component is separate and you must opt in to each module. You
  13. # must also opt into OpenGL (and OpenThreads?) as these modules won't do
  14. # it for you. This is to allow you control over your own system piece
  15. # by piece in case you need to opt out of certain components or change
  16. # the Find behavior for a particular module (perhaps because the default
  17. # FindOpenGL.cmake module doesn't work with your system as an example).
  18. # If you want to use a more convenient module that includes everything,
  19. # use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake
  20. # modules.
  21. #
  22. # Locate Producer This module defines PRODUCER_LIBRARY PRODUCER_FOUND,
  23. # if false, do not try to link to Producer PRODUCER_INCLUDE_DIR, where
  24. # to find the headers
  25. #
  26. # $PRODUCER_DIR is an environment variable that would correspond to the
  27. # ./configure --prefix=$PRODUCER_DIR used in building osg.
  28. #
  29. # Created by Eric Wing.
  30. #=============================================================================
  31. # Copyright 2007-2009 Kitware, Inc.
  32. #
  33. # Distributed under the OSI-approved BSD License (the "License");
  34. # see accompanying file Copyright.txt for details.
  35. #
  36. # This software is distributed WITHOUT ANY WARRANTY; without even the
  37. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  38. # See the License for more information.
  39. #=============================================================================
  40. # (To distribute this file outside of CMake, substitute the full
  41. # License text for the above reference.)
  42. # Header files are presumed to be included like
  43. # #include <Producer/CameraGroup>
  44. # Try the user's environment request before anything else.
  45. find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
  46. HINTS
  47. ENV PRODUCER_DIR
  48. ENV OSG_DIR
  49. ENV OSGDIR
  50. PATH_SUFFIXES include
  51. PATHS
  52. ~/Library/Frameworks
  53. /Library/Frameworks
  54. /sw/include # Fink
  55. /opt/local/include # DarwinPorts
  56. /opt/csw/include # Blastwave
  57. /opt/include
  58. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]/include
  59. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
  60. )
  61. find_library(PRODUCER_LIBRARY
  62. NAMES Producer
  63. HINTS
  64. ENV PRODUCER_DIR
  65. ENV OSG_DIR
  66. ENV OSGDIR
  67. PATH_SUFFIXES lib
  68. PATHS
  69. /sw
  70. /opt/local
  71. /opt/csw
  72. /opt
  73. )
  74. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  75. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Producer DEFAULT_MSG
  76. PRODUCER_LIBRARY PRODUCER_INCLUDE_DIR)