1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-05 14:18:53 +02:00
Leland Lucius e07b5df6f3 Reworked cmake command options
And fixed a recursion problem when copying DLLs to dest folder

The command options are now:

   // Enable Audio Unit plug-in support
   audacity_enable_audiounits:BOOL=ON

   // Library preference [system (if available), local]
   audacity_lib_preference:STRING=system

   // Use FileDialog library [local]
   audacity_use_FileDialog:STRING=local

   // Use expat library [local]
   audacity_use_expat:STRING=local

   // Use ffmpeg library [loaded, off]
   audacity_use_ffmpeg:STRING=off

   // Use flac library [system (if available), local, off]
   audacity_use_flac:STRING=local

   // Use id3tag library [system (if available), local, off]
   audacity_use_id3tag:STRING=local

   // Use LADSPA plug-in support [on, off]
   audacity_use_ladspa:BOOL=ON

   // Use lame library [system (if available), local]
   audacity_use_lame:STRING=local

   // Use libextra library [local]
   audacity_use_libextra:STRING=local

   // Use lv2 library [system (if available), local, off]
   audacity_use_lv2:STRING=local

   // Use mad library [system (if available), local, off]
   audacity_use_mad:STRING=local

   // Use midi library [system (if available), local, off]
   audacity_use_midi:STRING=local

   // Use nyquist library [local, off]
   audacity_use_nyquist:STRING=local

   // Use ogg library [system (if available), local, off]
   audacity_use_ogg:STRING=local

   // Use the portaudio CoreAudio interface if available
   audacity_use_pa_coreaudio:BOOL=YES

   // Use the JACK audio interface if available [loaded, linked, off]
   audacity_use_pa_jack:STRING=off

   // Use the OSS audio interface if available
   audacity_use_pa_oss:BOOL=NO

   // Use portaudio library [local]
   audacity_use_portaudio:STRING=local

   // Use portmixer library [local, off]
   audacity_use_portmixer:STRING=local

   // Use portsmf library [system (if available), local, off]
   audacity_use_portsmf:STRING=local

   // Use sbsms library [system (if available), local, off]
   audacity_use_sbsms:STRING=local

   // Use sndfile library [system (if available), local]
   audacity_use_sndfile:STRING=local

   // Use soundtouch library [system (if available), local, off]
   audacity_use_soundtouch:STRING=local

   // Use soxr library [system (if available), local]
   audacity_use_soxr:STRING=local

   // Use twolame library [system (if available), local, off]
   audacity_use_twolame:STRING=local

   // Use vamp library [system (if available), local, off]
   audacity_use_vamp:STRING=local

   // Use vorbis library [system (if available), local, off]
   audacity_use_vorbis:STRING=local

   // Use VST2 plug-in support [on, off]
   audacity_use_vst:BOOL=ON

   // Use wxwidgets library [system (if available), local]
   audacity_use_wxwidgets:STRING=system
2020-02-14 15:56:33 -06:00

242 lines
5.9 KiB
CMake

add_library( ${TARGET} STATIC )
def_vars()
set( CMAKE_MODULE_PATH ${TARGET_ROOT}/cmake_support )
# Define the platform specific interface options
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
cmd_option(
${_OPT}use_pa_ds
"Use the portaudio DirectSound interface if available"
YES
)
cmd_option(
${_OPT}use_pa_wasapi
"Use the portaudio WASAPI interface if available"
YES
)
cmd_option(
${_OPT}use_pa_wmme
"Use the portaudio WMME interface if available"
YES
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
cmd_option(
${_OPT}use_pa_coreaudio
"Use the portaudio CoreAudio interface if available"
YES
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
cmd_option(
${_OPT}use_pa_alsa
"Use the portaudio ALSA interface if available"
YES
)
if( ${_OPT}use_pa_alsa )
find_package( ALSA )
if( NOT ALSA_FOUND )
set_cache_value( ${_OPT}use_pa_alsa NO )
endif()
endif()
endif()
# Look for OSS if the user wants it
cmd_option(
${_OPT}use_pa_oss
"Use the OSS audio interface if available"
YES
)
if( ${_OPT}use_pa_oss )
find_path( OSS_INCLUDE NAMES sys/soundcard.h )
mark_as_advanced( FORCE OSS_INCLUDE )
if( OSS_INCLUDE )
set( OSS_INCLUDE_DIRS ${OSS_INCLUDE} )
endif()
find_library( OSS_LIBRARY NAMES ossaudio )
mark_as_advanced( FORCE OSS_LIBRARY )
if( OSS_LIBRARY )
set( OSS_LIBRARIES ${OSS_LIBRARY} )
endif()
if( NOT OSS_INCLUDE_DIRS )
set_cache_value( ${_OPT}use_pa_oss NO )
endif()
endif()
# JACK can be dynamically loaded, linked to, or off
cmd_option( ${_OPT}use_pa_jack
"Use the JACK audio interface if available [loaded, linked, off]"
"linked"
STRINGS "loaded" "linked" "off"
)
if( NOT ${_OPT}use_pa_jack STREQUAL "off" )
# Find it
find_package( Jack )
if( NOT JACK_FOUND)
set_cache_value( ${_OPT}use_pa_jack "off" )
endif()
endif()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/common/pa_allocation.c
${TARGET_ROOT}/src/common/pa_converters.c
${TARGET_ROOT}/src/common/pa_cpuload.c
${TARGET_ROOT}/src/common/pa_debugprint.c
${TARGET_ROOT}/src/common/pa_dither.c
${TARGET_ROOT}/src/common/pa_dynload.c
${TARGET_ROOT}/src/common/pa_front.c
${TARGET_ROOT}/src/common/pa_process.c
${TARGET_ROOT}/src/common/pa_ringbuffer.c
${TARGET_ROOT}/src/common/pa_stream.c
${TARGET_ROOT}/src/common/pa_trace.c
$<$<PLATFORM_ID:Windows>:
${TARGET_ROOT}/src/os/win/pa_win_coinitialize.c
${TARGET_ROOT}/src/os/win/pa_win_hostapis.c
${TARGET_ROOT}/src/os/win/pa_win_util.c
${TARGET_ROOT}/src/os/win/pa_win_waveformat.c
${TARGET_ROOT}/src/os/win/pa_win_wdmks_utils.c
${TARGET_ROOT}/src/os/win/pa_x86_plain_converters.c
>
$<$<PLATFORM_ID:Darwin>:
${TARGET_ROOT}/src/hostapi/coreaudio/pa_mac_core.c
${TARGET_ROOT}/src/hostapi/coreaudio/pa_mac_core_blocking.c
${TARGET_ROOT}/src/hostapi/coreaudio/pa_mac_core_utilities.c
>
$<$<PLATFORM_ID:Darwin,Linux,FreeBSD>:
${TARGET_ROOT}/src/os/unix/pa_unix_hostapis.c
${TARGET_ROOT}/src/os/unix/pa_unix_util.c
>
$<$<BOOL:${${_OPT}use_pa_ds}>:
${TARGET_ROOT}/src/hostapi/dsound/pa_win_ds.c
${TARGET_ROOT}/src/hostapi/dsound/pa_win_ds_dynlink.c
>
$<$<BOOL:${${_OPT}use_pa_wasapi}>:
${TARGET_ROOT}/src/hostapi/wasapi/pa_win_wasapi.c
>
$<$<BOOL:${${_OPT}use_pa_wmme}>:
${TARGET_ROOT}/src/hostapi/wmme/pa_win_wmme.c
>
$<$<BOOL:${${_OPT}use_pa_alsa}>:
${TARGET_ROOT}/src/hostapi/alsa/pa_linux_alsa.c
>
$<$<BOOL:${${_OPT}use_pa_oss}>:
${TARGET_ROOT}/src/hostapi/oss/pa_unix_oss.c
>
$<$<NOT:$<STREQUAL:${${_OPT}use_pa_jack},off>>:
${TARGET_ROOT}/src/hostapi/jack/pa_jack.c
${TARGET_ROOT}/src/hostapi/jack/pa_jack_dynload.c
>
)
list( APPEND INCLUDES
PRIVATE
${TARGET_ROOT}/src/common
$<$<PLATFORM_ID:Windows>:
${TARGET_ROOT}/src/os/win
>
$<$<PLATFORM_ID:Darwin,Linux,FreeBSD>:
${TARGET_ROOT}/src/os/unix
>
$<$<BOOL:${${_OPT}use_pa_ds}>:
${TARGET_ROOT}/src/hostapi/dsound
>
$<$<BOOL:${${_OPT}use_pa_coreaudio}>:
${TARGET_ROOT}/src/hostapi/coreaudio
>
$<$<BOOL:${${_OPT}use_pa_alsa}>:
${ALSA_INCLUDE_DIRS}
>
$<$<BOOL:${${_OPT}use_pa_oss}>:
${OSS_INCLUDE_DIRS}
>
$<$<NOT:$<STREQUAL:${${_OPT}use_pa_jack},off>>:
${TARGET_ROOT}/src/hostapi/jack
${JACK_INCLUDE_DIRS}
>
PUBLIC
${TARGET_ROOT}/include
)
list( APPEND DEFINES
PUBLIC
$<$<BOOL:${${_OPT}use_pa_ds}>:
PA_USE_DS=1
>
$<$<BOOL:${${_OPT}use_pa_wasapi}>:
PA_USE_WASAPI=1
>
$<$<BOOL:${${_OPT}use_pa_wmme}>:
PA_USE_WMME=1
>
$<$<BOOL:${${_OPT}use_pa_coreaudio}>:
PA_USE_COREAUDIO=1
>
$<$<BOOL:${${_OPT}use_pa_alsa}>:
PA_USE_ALSA=1
>
$<$<BOOL:${${_OPT}use_pa_oss}>:
PA_USE_OSS=1
HAVE_SYS_SOUNDCARD_H=1
>
$<$<NOT:$<STREQUAL:${${_OPT}use_pa_jack},off>>:
PA_USE_JACK=1
>
$<$<STREQUAL:${${_OPT}use_pa_jack},dynamic>:
PA_DYNAMIC_JACK=1
>
)
list( APPEND LIBRARIES
INTERFACE
$<$<BOOL:${${_OPT}use_pa_alsa}>:
${ALSA_LIBRARIES}
>
$<$<BOOL:${${_OPT}use_pa_oss}>:
${OSS_LIBRARIES}
>
$<$<NOT:$<STREQUAL:${${_OPT}use_pa_jack},off>>:
${JACK_LIBRARIES}
>
)
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )