FindCoin3D.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. # Copyright 2008-2009 Kitware, Inc.
  13. #
  14. # Distributed under the OSI-approved BSD License (the "License");
  15. # see accompanying file Copyright.txt for details.
  16. #
  17. # This software is distributed WITHOUT ANY WARRANTY; without even the
  18. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19. # See the License for more information.
  20. #=============================================================================
  21. # (To distribute this file outside of CMake, substitute the full
  22. # License text for the above reference.)
  23. if (WIN32)
  24. if (CYGWIN)
  25. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
  26. find_library(COIN3D_LIBRARIES Coin)
  27. else ()
  28. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
  29. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
  30. )
  31. find_library(COIN3D_LIBRARY_DEBUG coin2d
  32. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
  33. )
  34. find_library(COIN3D_LIBRARY_RELEASE coin2
  35. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
  36. )
  37. if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
  38. set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
  39. debug ${COIN3D_LIBRARY_DEBUG})
  40. else ()
  41. if (COIN3D_LIBRARY_DEBUG)
  42. set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
  43. endif ()
  44. if (COIN3D_LIBRARY_RELEASE)
  45. set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
  46. endif ()
  47. endif ()
  48. endif ()
  49. else ()
  50. if(APPLE)
  51. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
  52. /Library/Frameworks/Inventor.framework/Headers
  53. )
  54. find_library(COIN3D_LIBRARIES Coin
  55. /Library/Frameworks/Inventor.framework/Libraries
  56. )
  57. set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
  58. else()
  59. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
  60. find_library(COIN3D_LIBRARIES Coin)
  61. endif()
  62. endif ()
  63. # handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
  64. # all listed variables are TRUE
  65. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  66. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
  67. mark_as_advanced(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )