Panda3DConfig.cmake 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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::FMOD::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. # OpenGLES1 - Support for OpenGL ES 1.x rendering.
  96. #
  97. # Panda3D::OpenGLES1::pandagles
  98. #
  99. #
  100. # OpenGLES2 - Support for OpenGL ES 2.x+ rendering.
  101. #
  102. # Panda3D::OpenGLES2::pandagles2
  103. #
  104. #
  105. # TinyDisplay - Support for software rendering.
  106. #
  107. # Panda3D::TinyDisplay::p3tinydisplay
  108. #
  109. #
  110. # Vision - Support for vision processing.
  111. #
  112. # Panda3D::Vision::p3vision
  113. #
  114. #
  115. # VRPN - Support for connecting to a VRPN virtual reality server.
  116. #
  117. # Panda3D::VRPN::p3vrpn
  118. if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0)
  119. message(FATAL_ERROR "CMake >= 3.0.2 required")
  120. endif()
  121. get_filename_component(_panda_config_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
  122. include("${_panda_config_prefix}/Panda3DPackages.cmake")
  123. set(_panda_components
  124. Core Python Tools
  125. Direct Contrib Framework Egg
  126. Bullet ODE
  127. FFmpeg
  128. OpenAL FMOD
  129. OpenGL DX9 OpenGLES1 OpenGLES2 TinyDisplay
  130. Vision VRPN
  131. )
  132. set(Panda3D_FIND_REQUIRED_Core ON)
  133. foreach(_comp Core ${Panda3D_FIND_COMPONENTS})
  134. if(";${_panda_components};" MATCHES ";${_comp};" AND
  135. EXISTS "${_panda_config_prefix}/Panda3D${_comp}Targets.cmake")
  136. include("${_panda_config_prefix}/Panda3D${_comp}Targets.cmake")
  137. if(";${Panda3D_FIND_COMPONENTS};" MATCHES ";Python;" AND
  138. EXISTS "${_panda_config_prefix}/Panda3D${_comp}PythonTargets.cmake")
  139. include("${_panda_config_prefix}/Panda3D${_comp}PythonTargets.cmake")
  140. endif()
  141. elseif(Panda3D_FIND_REQUIRED_${_comp})
  142. message(FATAL_ERROR "Panda3D REQUIRED component ${_comp} not found")
  143. endif()
  144. endforeach(_comp)
  145. unset(_comp)
  146. unset(_panda_components)