Panda3DConfig.cmake 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # PANDA 3D SOFTWARE
  2. # Copyright (c) Carnegie Mellon University. All rights reserved.
  3. #
  4. # All use of this software is subject to the terms of the revised BSD
  5. # license. You should have received a copy of this license along
  6. # with this source code in a file named "LICENSE."
  7. #
  8. # Author: CFSworks (Dec. 11, 2018)
  9. # This file is installed to CMake's package search path, and is invoked for
  10. # find_package(Panda3D [COMPONENTS ...])
  11. #
  12. # The following components are available for importing:
  13. #
  14. # Core - The core Panda3D libraries; this component is always included.
  15. #
  16. # Panda3D::Core::panda
  17. # Panda3D::Core::pandaexpress
  18. # etc.
  19. #
  20. #
  21. # Python - Python targets, which can be used for linking against the Python
  22. # extension modules directly. Note that this also imports the
  23. # Python bindings for other requested components that have them.
  24. #
  25. # Panda3D::Python::panda3d.core
  26. # Panda3D::Python::panda3d.physics
  27. # etc.
  28. #
  29. #
  30. # Tools - Various tools used in asset manipulation and debugging.
  31. #
  32. # Panda3D::Tools::egg2bam
  33. # Panda3D::Tools::egg-optchar
  34. # Panda3D::Tools::pview
  35. # etc.
  36. #
  37. #
  38. # Direct - Panda's "direct" Python framework; C++ support library.
  39. #
  40. # Panda3D::Direct::p3direct
  41. #
  42. #
  43. # Contrib - Extensions not part of the Panda3D core, but contributed by the
  44. # community.
  45. #
  46. # Panda3D::Contrib::p3ai
  47. # Panda3D::Contrib::p3rplight
  48. #
  49. #
  50. # Framework - Panda's "p3framework" C++ framework.
  51. #
  52. # Panda3D::Framework::p3framework
  53. #
  54. #
  55. # Egg - Support for the Egg file format.
  56. #
  57. # Panda3D::Egg::pandaegg
  58. #
  59. #
  60. # Bullet - Support for Bullet physics.
  61. #
  62. # Panda3D::Bullet::p3bullet
  63. #
  64. #
  65. # ODE - Support for the ODE physics engine.
  66. #
  67. # Panda3D::ODE::p3ode
  68. #
  69. #
  70. # FFmpeg - Support for FFmpeg media format loading.
  71. #
  72. # Panda3D::FFmpeg::p3ffmpeg
  73. #
  74. #
  75. # OpenAL - Support for OpenAL audio output.
  76. #
  77. # Panda3D::OpenAL::p3openal_audio
  78. #
  79. #
  80. # FMOD - Support for FMOD audio output.
  81. #
  82. # Panda3D::OpenAL::p3fmod_audio
  83. #
  84. #
  85. # OpenGL - Support for OpenGL rendering.
  86. #
  87. # Panda3D::OpenGL::pandagl
  88. #
  89. #
  90. # DX9 - Support for Direct3D 9 rendering.
  91. #
  92. # Panda3D::DX9::pandadx9
  93. #
  94. #
  95. # GLES - Support for OpenGL ES rendering.
  96. #
  97. # Panda3D::GLES::pandagles
  98. # Panda3D::GLES::pandagles2
  99. #
  100. #
  101. # Vision - Support for vision processing.
  102. #
  103. # Panda3D::Vision::p3vision
  104. #
  105. #
  106. # VRPN - Support for connecting to a VRPN virtual reality server.
  107. #
  108. # Panda3D::VRPN::p3vrpn
  109. if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0)
  110. message(FATAL_ERROR "CMake >= 3.0.2 required")
  111. endif()
  112. get_filename_component(_panda_config_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
  113. include("${_panda_config_prefix}/Panda3DPackages.cmake")
  114. set(_panda_components
  115. Core Python Tools
  116. Direct Contrib Framework Egg
  117. Bullet ODE
  118. FFmpeg
  119. OpenAL FMOD
  120. OpenGL DX9 GLES
  121. Vision VRPN
  122. )
  123. set(Panda3D_FIND_REQUIRED_Core ON)
  124. foreach(_comp Core ${Panda3D_FIND_COMPONENTS})
  125. if(";${_panda_components};" MATCHES ";${_comp};" AND
  126. EXISTS "${_panda_config_prefix}/Panda3D${_comp}Targets.cmake")
  127. include("${_panda_config_prefix}/Panda3D${_comp}Targets.cmake")
  128. if(";${Panda3D_FIND_COMPONENTS};" MATCHES ";Python;" AND
  129. EXISTS "${_panda_config_prefix}/Panda3D${_comp}PythonTargets.cmake")
  130. include("${_panda_config_prefix}/Panda3D${_comp}PythonTargets.cmake")
  131. endif()
  132. elseif(Panda3D_FIND_REQUIRED_${_comp})
  133. message(FATAL_ERROR "Panda3D REQUIRED component ${_comp} not found")
  134. endif()
  135. endforeach(_comp)
  136. unset(_comp)
  137. unset(_panda_components)