FindCoin3D.cmake 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindCoin3D
  5. ----------
  6. Find Coin3D (Open Inventor)
  7. Coin3D is an implementation of the Open Inventor API. It provides
  8. data structures and algorithms for 3D visualization.
  9. This module defines the following variables
  10. ::
  11. COIN3D_FOUND - system has Coin3D - Open Inventor
  12. COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
  13. COIN3D_LIBRARIES - Link to this to use Coin3D
  14. #]=======================================================================]
  15. if (WIN32)
  16. if (CYGWIN)
  17. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
  18. find_library(COIN3D_LIBRARIES Coin)
  19. else ()
  20. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
  21. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
  22. )
  23. find_library(COIN3D_LIBRARY_DEBUG coin2d
  24. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
  25. )
  26. find_library(COIN3D_LIBRARY_RELEASE coin2
  27. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
  28. )
  29. if (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
  30. set(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
  31. debug ${COIN3D_LIBRARY_DEBUG})
  32. else ()
  33. if (COIN3D_LIBRARY_DEBUG)
  34. set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
  35. endif ()
  36. if (COIN3D_LIBRARY_RELEASE)
  37. set (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
  38. endif ()
  39. endif ()
  40. endif ()
  41. else ()
  42. if(APPLE)
  43. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h
  44. /Library/Frameworks/Inventor.framework/Headers
  45. )
  46. find_library(COIN3D_LIBRARIES Coin
  47. /Library/Frameworks/Inventor.framework/Libraries
  48. )
  49. set(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
  50. else()
  51. find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
  52. find_library(COIN3D_LIBRARIES Coin)
  53. endif()
  54. endif ()
  55. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  56. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
  57. mark_as_advanced(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )