Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / FindCoin3D.cmake
1 # - Find Coin3D (Open Inventor)
2 # Coin3D is an implementation of the Open Inventor API.
3 # It provides data structures and algorithms for 3D visualization
4 # http://www.coin3d.org/
5 #
6 # This module defines the following variables
7 #  COIN3D_FOUND         - system has Coin3D - Open Inventor
8 #  COIN3D_INCLUDE_DIRS  - where the Inventor include directory can be found
9 #  COIN3D_LIBRARIES     - Link to this to use Coin3D
10 #
11
12 #=============================================================================
13 # Copyright 2008-2009 Kitware, Inc.
14 #
15 # Distributed under the OSI-approved BSD License (the "License");
16 # see accompanying file Copyright.txt for details.
17 #
18 # This software is distributed WITHOUT ANY WARRANTY; without even the
19 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 # See the License for more information.
21 #=============================================================================
22 # (To distribute this file outside of CMake, substitute the full
23 #  License text for the above reference.)
24
25 if (WIN32)
26   if (CYGWIN)
27
28     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
29     find_library(COIN3D_LIBRARIES Coin)
30
31   else ()
32
33     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
34       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
35     )
36
37     find_library(COIN3D_LIBRARY_DEBUG coin2d
38       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
39     )
40
41     find_library(COIN3D_LIBRARY_RELEASE coin2
42       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
43     )
44
45     if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
46       set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
47                            debug ${COIN3D_LIBRARY_DEBUG})
48     else ()
49       if (COIN3D_LIBRARY_DEBUG)
50         set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
51       endif ()
52       if (COIN3D_LIBRARY_RELEASE)
53         set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
54       endif ()
55     endif ()
56
57   endif ()
58
59 else ()
60   if(APPLE)
61     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
62      /Library/Frameworks/Inventor.framework/Headers
63     )
64     find_library(COIN3D_LIBRARIES Coin
65       /Library/Frameworks/Inventor.framework/Libraries
66     )
67     set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
68   else()
69
70     find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
71     find_library(COIN3D_LIBRARIES Coin)
72
73   endif()
74
75 endif ()
76
77 # handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
78 # all listed variables are TRUE
79 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
80 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
81
82 mark_as_advanced(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
83
84