FindProducer.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. #=============================================================================
  28. # Copyright 2007-2009 Kitware, Inc.
  29. #
  30. # Distributed under the OSI-approved BSD License (the "License");
  31. # see accompanying file Copyright.txt for details.
  32. #
  33. # This software is distributed WITHOUT ANY WARRANTY; without even the
  34. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  35. # See the License for more information.
  36. #=============================================================================
  37. # (To distribute this file outside of CMake, substitute the full
  38. # License text for the above reference.)
  39. # Header files are presumed to be included like
  40. # #include <Producer/CameraGroup>
  41. # Try the user's environment request before anything else.
  42. find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
  43. HINTS
  44. $ENV{PRODUCER_DIR}
  45. $ENV{OSG_DIR}
  46. $ENV{OSGDIR}
  47. PATH_SUFFIXES include
  48. PATHS
  49. ~/Library/Frameworks
  50. /Library/Frameworks
  51. /sw/include # Fink
  52. /opt/local/include # DarwinPorts
  53. /opt/csw/include # Blastwave
  54. /opt/include
  55. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]/include
  56. [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
  57. )
  58. find_library(PRODUCER_LIBRARY
  59. NAMES Producer
  60. HINTS
  61. $ENV{PRODUCER_DIR}
  62. $ENV{OSG_DIR}
  63. $ENV{OSGDIR}
  64. PATH_SUFFIXES lib64 lib
  65. PATHS
  66. /sw
  67. /opt/local
  68. /opt/csw
  69. /opt
  70. )
  71. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  72. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Producer DEFAULT_MSG
  73. PRODUCER_LIBRARY PRODUCER_INCLUDE_DIR)