Package.cmake 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. #
  2. # ------------ Eigen ------------
  3. #
  4. find_package(Eigen3 QUIET)
  5. package_option(EIGEN
  6. "Enables experimental support for the Eigen linear algebra library.
  7. If this is provided, Panda will use this library as the fundamental
  8. implementation of its own linmath library; otherwise, it will use
  9. its own internal implementation. The primary advantage of using
  10. Eigen is SSE2 support, which is only activated if LINMATH_ALIGN
  11. is also enabled."
  12. FOUND_AS EIGEN3
  13. LICENSE "MPL-2")
  14. option(LINMATH_ALIGN
  15. "This is required for activating SSE2 support using Eigen.
  16. Activating this does constrain most objects in Panda to 16-byte
  17. alignment, which could impact memory usage on very-low-memory
  18. platforms. Currently experimental." ON)
  19. if(LINMATH_ALIGN)
  20. config_package(EIGEN "Eigen linear algebra library" "vectorization enabled in build")
  21. else()
  22. config_package(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build")
  23. endif()
  24. #
  25. # ------------ OpenSSL ------------
  26. #
  27. find_package(OpenSSL COMPONENTS ssl crypto QUIET)
  28. package_option(OPENSSL DEFAULT ON
  29. "Enable OpenSSL support")
  30. option(REPORT_OPENSSL_ERRORS
  31. "Define this true to include the OpenSSL code to report verbose
  32. error messages when they occur." ${IS_DEBUG_BUILD})
  33. if(REPORT_OPENSSL_ERRORS)
  34. config_package(OPENSSL "OpenSSL" "with verbose error reporting")
  35. else()
  36. config_package(OPENSSL "OpenSSL")
  37. endif()
  38. #
  39. # ------------ IMAGE FORMATS ------------
  40. #
  41. # JPEG:
  42. find_package(JPEG QUIET)
  43. package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.")
  44. config_package(JPEG "libjpeg")
  45. # PNG:
  46. find_package(PNG QUIET)
  47. package_option(PNG DEFAULT ON "Enable support for loading .png images.")
  48. config_package(PNG "libpng")
  49. # TIFF:
  50. find_package(TIFF QUIET)
  51. package_option(TIFF "Enable support for loading .tif images.")
  52. config_package(TIFF "libtiff")
  53. #
  54. # ------------ LIBTAR ------------
  55. #
  56. find_package(Tar QUIET)
  57. package_option(TAR
  58. "This is used to optimize patch generation against tar files.")
  59. config_package(TAR "libtar")
  60. #
  61. # ------------ FFTW ------------
  62. #
  63. find_package(FFTW3 QUIET)
  64. package_option(FFTW
  65. "This enables support for compression of animations in .bam files.
  66. This is only necessary for creating or reading .bam files containing
  67. compressed animations."
  68. FOUND_AS "FFTW3"
  69. LICENSE "GPL")
  70. config_package(FFTW "FFTW")
  71. #
  72. # ------------ libsquish ------------
  73. #
  74. find_package(LibSquish QUIET)
  75. package_option(SQUISH
  76. "Enables support for automatic compression of DXT textures."
  77. FOUND_AS LIBSQUISH)
  78. config_package(SQUISH "libsquish")
  79. #
  80. # ------------ Nvidia Cg ------------
  81. #
  82. find_package(Cg QUIET)
  83. package_option(CG
  84. "Enable support for Nvidia Cg Shading Language"
  85. LICENSE "Nvidia")
  86. package_option(CGGL
  87. "Enable support for Nvidia Cg's OpenGL API."
  88. LICENSE "Nvidia")
  89. package_option(CGDX9
  90. "Enable support for Nvidia Cg's DirectX 9 API."
  91. LICENSE "Nvidia")
  92. if(HAVE_CGGL AND HAVE_CGDX9)
  93. set(cg_apis "supporting OpenGL and DirectX 9")
  94. elseif(HAVE_CGGL)
  95. set(cg_apis "supporting OpenGL")
  96. elseif(HAVE_CGDX9)
  97. set(cg_apis "supporting DirectX 9")
  98. else()
  99. set(cg_apis "WITHOUT rendering backend support")
  100. endif()
  101. config_package(CG "Nvidia Cg Shading Language" "${cg_apis}")
  102. #
  103. # ------------ VRPN ------------
  104. #
  105. find_package(VRPN QUIET)
  106. package_option(VRPN
  107. "Enables support for connecting to VRPN servers. This is only needed if you
  108. are building Panda3D for a fixed VRPN-based VR installation.")
  109. config_package(VRPN "VRPN")
  110. #
  111. # ------------ zlib ------------
  112. #
  113. find_package(zlib QUIET)
  114. package_option(ZLIB
  115. "Enables support for compression of Panda assets.")
  116. config_package(ZLIB "zlib")
  117. #
  118. # ------------ FFmpeg ------------
  119. #
  120. find_package(FFMPEG QUIET)
  121. find_package(SWScale QUIET)
  122. find_package(SWResample QUIET)
  123. package_option(FFMPEG
  124. "Enables support for audio- and video-decoding using the FFmpeg library.")
  125. package_option(SWSCALE
  126. "Enables support for FFmpeg's libswscale for video rescaling.")
  127. package_option(SWRESAMPLE
  128. "Enables support for FFmpeg's libresample for audio resampling.")
  129. if(HAVE_SWSCALE AND HAVE_SWRESAMPLE)
  130. set(ffmpeg_features "with swscale and swresample")
  131. elseif(HAVE_SWSCALE)
  132. set(ffmpeg_features "with swscale")
  133. elseif(HAVE_SWRESAMPLE)
  134. set(ffmpeg_features "with swresample")
  135. else()
  136. set(ffmpeg_features "without resampling/rescaling support")
  137. endif()
  138. config_package(FFMPEG "FFmpeg" "${ffmpeg_features}")
  139. #
  140. # ------------ Audio libraries ------------
  141. #
  142. # Miles Sound System
  143. find_package(Miles QUIET)
  144. package_option(RAD_MSS
  145. "This enables support for audio output via the Miles Sound System,
  146. by RAD Game Tools. This requires a commercial license to use, so you'll know
  147. if you need to enable this option."
  148. FOUND_AS Miles
  149. LICENSE "Miles")
  150. config_package(RAD_MSS "Miles Sound System")
  151. # FMOD Ex
  152. find_package(FMODEx QUIET)
  153. package_option(FMODEX
  154. "This enables support for the FMOD Ex sound library,
  155. from Firelight Technologies. This audio library is free for non-commercial
  156. use."
  157. LICENSE "FMOD")
  158. config_package(FMODEX "FMOD Ex sound library")
  159. # OpenAL
  160. find_package(OpenAL QUIET)
  161. package_option(OPENAL
  162. "This enables support for audio output via OpenAL. Some platforms, such as
  163. macOS, provide their own OpenAL implementation, which Panda3D can use. But,
  164. on most platforms this will imply OpenAL Soft, which is LGPL licensed."
  165. LICENSE "LGPL")
  166. config_package(OPENAL "OpenAL sound library")
  167. #
  168. # ------------ FreeType ------------
  169. #
  170. find_package(Freetype QUIET)
  171. package_option(FREETYPE
  172. "This enables support for the FreeType font-rendering library. If disabled,
  173. Panda3D will only be able to read fonts specially made with egg-mkfont.")
  174. config_package(FREETYPE "FreeType")
  175. # Find and configure GTK
  176. set(Freetype_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2
  177. set(GTK2_GTK_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2
  178. find_package(GTK2 QUIET COMPONENTS gtk)
  179. #config_package(GTK2 "gtk+-2")
  180. package_option(GTK2)
  181. #
  182. # ------------ Physics engines ------------
  183. #
  184. # Bullet
  185. find_package(Bullet QUIET)
  186. package_option(Bullet
  187. "Enable this option to support game dynamics with the Bullet physics library.")
  188. config_package(Bullet "Bullet physics")
  189. # ODE
  190. find_package(ODE QUIET)
  191. package_option(ODE
  192. "Enable this option to support game dynamics with the Open Dynamics Engine (ODE)."
  193. LICENSE "BSD-3")
  194. config_package(ODE "Open Dynamics Engine")
  195. # PhysX
  196. find_package(PhysX QUIET)
  197. package_option(PhysX
  198. "Enable this option to support game dynamics with Nvidia PhysX."
  199. LICENSE "Nvidia")
  200. config_package(PhysX "Nvidia PhysX")
  201. ########
  202. # TODO #
  203. ########
  204. # Find and configure PhysX
  205. #find_package(PhysX)
  206. #config_package(PHYSX "Aegia PhysX")
  207. # Find and configure SpeedTree
  208. #find_package(SpeedTree)
  209. #config_package(SPEEDTREE "SpeedTree")
  210. # Find and configure OpenGL ES 1
  211. #find_package(GLES)
  212. #config_package(GLES COMMENT "OpenGL ES 1")
  213. # Find and configure OpenGL ES 2
  214. #find_package(GLES)
  215. #config_package(GLES COMMENT "OpenGL ES 2")
  216. # Find and configure DirectX 9
  217. #find_package(DX9)
  218. #config_package(DX9 COMMENT "DirectX9")
  219. # Find and configure OpenCV
  220. #find_package(OpenCV)
  221. #config_package(OPENCV COMMENT "OpenCV")
  222. # Find and configure FFMPEG
  223. #find_package(FFMPEG)
  224. #config_package(FFMPEG)
  225. # Find and configure ODE
  226. #find_package(ODE)
  227. #config_package(ODE)
  228. # Find and configure Awesomium
  229. #find_package(Awesomium)
  230. #config_package(AWESOMIUM COMMENT "Awesomium")
  231. # Find and configure OpenMaya
  232. #find_package(OpenMaya)
  233. #config_package(MAYA COMMENT "OpenMaya")
  234. # Find and configure FCollada
  235. #find_package(FCollada)
  236. #config_package(FCOLLADA COMMENT "FCollada")
  237. #if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM)
  238. # set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM")
  239. # if(USE_COLLADA)
  240. # if(FOUND_COLLADA15DOM)
  241. # set(HAVE_COLLADA15DOM TRUE)
  242. # else()
  243. # set(HAVE_COLLADA14DOM TRUE)
  244. # endif()
  245. # endif()
  246. #endif()
  247. # Find and configure Assimp
  248. #find_package(Assimp)
  249. #config_package(ASSIMP COMMENT "Assimp")
  250. # Find and configure ARToolKit
  251. #find_package(ARToolKit)
  252. #config_package(ARTOOLKIT COMMENT "ARToolKit")
  253. # Find and configure libRocket
  254. #find_package(Rocket)
  255. #config_package(ROCKET COMMENT "libRocket")
  256. #if(HAVE_ROCKET AND HAVE_PYTHON)
  257. # # Check for rocket python bindings
  258. # if(FOUND_ROCKET_PYTHON)
  259. # option(USE_ROCKET_PYTHON "If on, compile Panda3D with python bindings for libRocket" ON)
  260. # if(USE_ROCKET_PYTHON)
  261. # set(HAVE_ROCKET_PYTHON TRUE)
  262. # endif()
  263. # else()
  264. # unset(USE_ROCKET_PYTHON CACHE)
  265. # endif()
  266. # if(HAVE_ROCKET_PYTHON)
  267. # message(STATUS "+ libRocket with Python bindings")
  268. # else()
  269. # message(STATUS "+ libRocket without Python bindings")
  270. # endif()
  271. #else()
  272. # unset(USE_ROCKET_PYTHON CACHE)
  273. #endif()
  274. # Find and configure Bullet
  275. #find_package(Bullet)
  276. #config_package(BULLET COMMENT "Bullet Physics")
  277. # Find and configure Vorbis
  278. #find_package(Vorbis)
  279. #config_package(VORBIS COMMENT "Vorbis Ogg decoder")