Browse Source

CMake: Migrate detection of the audio libraries

Sam Edwards 7 years ago
parent
commit
2717c24ffc
3 changed files with 32 additions and 30 deletions
  1. 0 18
      dtool/LocalSetup.cmake
  2. 27 12
      dtool/Package.cmake
  3. 5 0
      panda/src/audiotraits/CMakeLists.txt

+ 0 - 18
dtool/LocalSetup.cmake

@@ -189,24 +189,6 @@ endif()
 # Now go through all the packages and report whether we have them.
 # Now go through all the packages and report whether we have them.
 show_packages()
 show_packages()
 
 
-if(HAVE_RAD_MSS)
-  message("+ Miles Sound System")
-else()
-  message("- Did not find Miles Sound System")
-endif()
-
-if(HAVE_FMODEX)
-  message("+ FMOD Ex sound library")
-else()
-  message("- Did not find FMOD Ex sound library")
-endif()
-
-if(HAVE_OPENAL)
-  message("+ OpenAL sound library")
-else()
-  message("- Did not find OpenAL sound library")
-endif()
-
 if(HAVE_PHYSX)
 if(HAVE_PHYSX)
   message("+ Ageia PhysX")
   message("+ Ageia PhysX")
 else()
 else()

+ 27 - 12
dtool/Package.cmake

@@ -172,22 +172,37 @@ else()
 endif()
 endif()
 config_package(FFMPEG "FFmpeg" "${ffmpeg_features}")
 config_package(FFMPEG "FFmpeg" "${ffmpeg_features}")
 
 
+#
+# ------------ Audio libraries ------------
+#
 
 
-# Find and configure Miles Sound System
+# Miles Sound System
 find_package(Miles QUIET)
 find_package(Miles QUIET)
-#config_package(RAD_MSS "Miles Sound System")
-package_option(RAD_MSS)
-
-# Find and configure FMOD Ex
+package_option(RAD_MSS
+  "This enables support for audio output via the Miles Sound System,
+  by RAD Game Tools. This requires a commercial license to use, so you'll know
+  if you need to enable this option."
+  FOUND_AS Miles
+  LICENSE "Miles")
+config_package(RAD_MSS "Miles Sound System")
+
+# FMOD Ex
 find_package(FMODEx QUIET)
 find_package(FMODEx QUIET)
-#config_package(FMODEX "FMOD Ex sound library")
-package_option(FMODEX)
-
-# Find and configure OpenAL
+package_option(FMODEX
+  "This enables support for the FMOD Ex sound library,
+  from Firelight Technologies. This audio library is free for non-commercial
+  use."
+  LICENSE "FMOD")
+config_package(FMODEX "FMOD Ex sound library")
+
+# OpenAL
 find_package(OpenAL QUIET)
 find_package(OpenAL QUIET)
-#config_package(OPENAL "OpenAL sound library")
-package_option(OPENAL)
-
+package_option(OPENAL
+  "This enables support for audio output via OpenAL. Some platforms, such as
+  macOS, provide their own OpenAL implementation, which Panda3D can use. But,
+  on most platforms this will imply OpenAL Soft, which is LGPL licensed."
+  LICENSE "LGPL")
+config_package(OPENAL "OpenAL sound library")
 
 
 # Find and configure Freetype
 # Find and configure Freetype
 find_package(Freetype QUIET)
 find_package(Freetype QUIET)

+ 5 - 0
panda/src/audiotraits/CMakeLists.txt

@@ -61,4 +61,9 @@ if(HAVE_AUDIO)
     install(TARGETS p3openal_audio DESTINATION lib)
     install(TARGETS p3openal_audio DESTINATION lib)
   endif()
   endif()
 
 
+  if(NOT HAVE_RAD_MSS AND NOT HAVE_FMODEX AND NOT HAVE_OPENAL)
+    message(SEND_ERROR
+      "You must have an audio backend for audio support! Turn off HAVE_AUDIO to ignore this.")
+  endif()
+
 endif()
 endif()