FindCoin3D.cmake 2.7 KB

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