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