From 2717c24ffc31c673a96e7569a29c9f5c9d255f4a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 18:19:45 -0700 Subject: [PATCH] CMake: Migrate detection of the audio libraries --- dtool/LocalSetup.cmake | 18 -------------- dtool/Package.cmake | 35 ++++++++++++++++++++-------- panda/src/audiotraits/CMakeLists.txt | 5 ++++ 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 9adc77afd9..b9d331e92e 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,24 +189,6 @@ endif() # Now go through all the packages and report whether we have them. 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) message("+ Ageia PhysX") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 626b0db4a8..b965c0244c 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -172,22 +172,37 @@ else() endif() config_package(FFMPEG "FFmpeg" "${ffmpeg_features}") +# +# ------------ Audio libraries ------------ +# -# Find and configure Miles Sound System +# Miles Sound System find_package(Miles QUIET) -#config_package(RAD_MSS "Miles Sound System") -package_option(RAD_MSS) +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") -# Find and configure FMOD Ex +# FMOD Ex find_package(FMODEx QUIET) -#config_package(FMODEX "FMOD Ex sound library") -package_option(FMODEX) +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") -# Find and configure OpenAL +# OpenAL 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_package(Freetype QUIET) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 42732d182f..52d090e794 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -61,4 +61,9 @@ if(HAVE_AUDIO) install(TARGETS p3openal_audio DESTINATION lib) 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()