Panda3DConfig.cmake 3.9 KB

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