FindCoin3D.cmake 2.69 KB
Newer Older
1 2 3 4 5 6 7
#.rst:
# FindCoin3D
# ----------
#
# Find Coin3D (Open Inventor)
#
# Coin3D is an implementation of the Open Inventor API.  It provides
8
# data structures and algorithms for 3D visualization.
9 10 11
#
# This module defines the following variables
#
12 13 14 15 16
# ::
#
#   COIN3D_FOUND         - system has Coin3D - Open Inventor
#   COIN3D_INCLUDE_DIRS  - where the Inventor include directory can be found
#   COIN3D_LIBRARIES     - Link to this to use Coin3D
17 18 19 20 21 22 23 24 25 26 27

#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
28
# (To distribute this file outside of CMake, substitute the full
29
#  License text for the above reference.)
30

31 32
if (WIN32)
  if (CYGWIN)
33

34 35
    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
    find_library(COIN3D_LIBRARIES Coin)
36

37
  else ()
38

39
    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
40 41 42
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
    )

43
    find_library(COIN3D_LIBRARY_DEBUG coin2d
44 45 46
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
    )

47
    find_library(COIN3D_LIBRARY_RELEASE coin2
48 49 50
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
    )

51 52
    if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
      set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
53
                           debug ${COIN3D_LIBRARY_DEBUG})
54
    else ()
55 56
      if (COIN3D_LIBRARY_DEBUG)
        set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
57
      endif ()
58 59
      if (COIN3D_LIBRARY_RELEASE)
        set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
60 61
      endif ()
    endif ()
62

63
  endif ()
64

65
else ()
66 67
  if(APPLE)
    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
68
     /Library/Frameworks/Inventor.framework/Headers
69
    )
70
    find_library(COIN3D_LIBRARIES Coin
71
      /Library/Frameworks/Inventor.framework/Libraries
72
    )
73
    set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
74
  else()
75

76 77
    find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
    find_library(COIN3D_LIBRARIES Coin)
78

79
  endif()
80

81
endif ()
82

83
# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
84
# all listed variables are TRUE
85
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
86 87
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)

88
mark_as_advanced(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
89 90