Last major update to the cmake build

I'm sure there will be further minor updates, but this
should be the last major update and it should be ready
for testing.

Audacity specific cmake options (cmake -Doption=<yes|no>) include:

   // Disable dynamic loading of ffmpeg libraries
   disable_dynamic_ffmpeg:BOOL=OFF

   // Disable dynamic loading of JACK libraries
   disable_dynamic_jack:BOOL=ON

   // Enable ffmpeg library
   enable_ffmpeg:BOOL=ON

   // Enable flac library
   enable_flac:BOOL=ON

   // Enable id3tag library
   enable_id3tag:BOOL=ON

   // Enable LADSPA plug-in support
   enable_ladspa:BOOL=ON

   // Enable lv2 library
   enable_lv2:BOOL=ON

   // Enable mad library
   enable_mad:BOOL=ON

   // Enable midi library
   enable_midi:BOOL=ON

   // Enable nyquist library
   enable_nyquist:BOOL=ON

   // Enable ogg library
   enable_ogg:BOOL=ON

   // Enable portmixer library
   enable_portmixer:BOOL=ON

   // Enable portsmf library
   enable_portsmf:BOOL=ON

   // Enable sbsms library
   enable_sbsms:BOOL=ON

   // Enable soundtouch library
   enable_soundtouch:BOOL=ON

   // Enable twolame library
   enable_twolame:BOOL=ON

   // Enable vamp library
   enable_vamp:BOOL=ON

   // Enable vorbis library
   enable_vorbis:BOOL=ON

   // Enable VST2 plug-in support
   enable_vst:BOOL=ON

   // Use system libraries if available
   prefer_system_libs:BOOL=ON

   // Enable the portaudio ALSA interface if available
   use_pa_alsa:BOOL=ON

   // Enable the portaudio CoreAudio interface if available
   use_pa_coreaudio:BOOL=ON

   // Enable the portaudio DirectSound interface if available
   use_pa_ds:BOOL=ON

   // Use the JACK audio interface if available
   use_pa_jack:BOOL=ON

   // Use the OSS audio interface if available
   use_pa_oss:BOOL=ON

   // Enable the portaudio WASAPI interface if available
   use_pa_wasapi:BOOL=ON

   // Enable the portaudio WMME interface if available
   use_pa_wmme:BOOL=ON

   // Use ffmpeg system library if available
   use_system_ffmpeg:BOOL=ON

   // Use flac system library if available
   use_system_flac:BOOL=ON

   // Use id3tag system library if available
   use_system_id3tag:BOOL=ON

   // Use lame system library if available
   use_system_lame:BOOL=ON

   // Use lv2 system library if available
   use_system_lv2:BOOL=ON

   // Use mad system library if available
   use_system_mad:BOOL=ON

   // Use midi system library if available
   use_system_midi:BOOL=ON

   // Use ogg system library if available
   use_system_ogg:BOOL=ON

   // Use portsmf system library if available
   use_system_portsmf:BOOL=ON

   // Use sbsms system library if available
   use_system_sbsms:BOOL=ON

   // Use sndfile system library if available
   use_system_sndfile:BOOL=ON

   // Use soundtouch system library if available
   use_system_soundtouch:BOOL=ON

   // Use soxr system library if available
   use_system_soxr:BOOL=ON

   // Use twolame system library if available
   use_system_twolame:BOOL=ON

   // Use vamp system library if available
   use_system_vamp:BOOL=ON

   // Use vorbis system library if available
   use_system_vorbis:BOOL=ON

   // Use wxwidgets system library if available
   use_system_wxwidgets:BOOL=ON
This commit is contained in:
Leland Lucius 2020-02-11 01:15:26 -06:00
parent 371afa3ffa
commit 70bbfb69d5
31 changed files with 758 additions and 483 deletions

View File

@ -63,6 +63,12 @@ set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules)
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
# Use ccache if available
find_program( CCACHE_PROGRAM ccache )
if( CCACHE_PROGRAM )
set_property( GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}" )
endif()
# Our very own project
project( Audacity )
@ -118,10 +124,15 @@ if( HAVE_LIBM )
list( APPEND CMAKE_REQUIRED_LIBRARIES -lm )
endif()
# Add the dynamic linker library (if found) to the list of required libraries
check_library_exists( dl dlopen "" HAVE_LIBDL )
if( HAVE_LIBDL )
list( APPEND CMAKE_REQUIRED_LIBRARIES -ldl )
# Add the dynamic linker library (if needed) to the list of required libraries
list( APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS} )
# May be a misconfiguration in my system, but CMake doesn't want to look
# in /usr/local/lib by default...so force the issue
if( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
list( APPEND CMAKE_EXE_LINKER_FLAGS -L/usr/local/lib )
list( APPEND CMAKE_MODULE_LINKER_FLAGS -L/usr/local/lib )
list( APPEND CMAKE_SHARED_LINKER_FLAGS -L/usr/local/lib )
endif()
# Make sure they're used during the link steps
@ -130,10 +141,35 @@ set( CMAKE_LINK_INTERFACE_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
# Various common checks whose results are used by the various targets
test_big_endian( WORDS_BIGENDIAN )
# Check for various compiler flags
if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
check_cxx_compiler_flag( "-mmmx" HAVE_MMX )
if( HAVE_MMX )
set( MMX_FLAG "-mmmx" CACHE INTERNAL "" )
endif()
check_cxx_compiler_flag( "-msse" HAVE_SSE )
if( HAVE_SSE )
set( SSE_FLAG "-msse" CACHE INTERNAL "" )
endif()
check_cxx_compiler_flag( "-msse2" HAVE_SSE2 )
if( HAVE_SSE2 )
set( SSE_FLAG "-msse2" CACHE INTERNAL "" )
endif()
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
set( HAVE_MMX ON )
set( MMX_FLAG "" )
set( HAVE_SSE ON )
set( SSE_FLAG "/arch:SSE" )
set( HAVE_SSE2 ON )
set( SSE2_FLAG "/arch:SSE2" )
endif()
check_include_files( "float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS )
check_include_file( "byteswap.h" HAVE_BYTESWAP_H )
check_include_file( "assert.h" HAVE_ASSERT_H )
check_include_file( "byteswap.h" HAVE_BYTESWAP_H )
check_include_file( "errno.h" HAVE_ERRNO_H )
check_include_file( "fcntl.h" HAVE_FCNTL_H )
check_include_file( "fenv.h" HAVE_FENV_H )
@ -151,12 +187,15 @@ check_include_file( "xmmintrin.h" HAVE_XMMINTRIN_H )
check_include_file( "sys/param.h" HAVE_SYS_PARAM_H )
check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
check_include_file( "sys/wait.h" HAVE_SYS_WAIT_H )
check_symbol_exists( bcopy "strings.h" HAVE_BCOPY )
check_symbol_exists( fileno "stdio.h" HAVE_FILENO )
check_symbol_exists( flock "sys/file.h" HAVE_FLOCK )
check_symbol_exists( fork "unistd.h" HAVE_FORK )
check_symbol_exists( fsync "unistd.h" HAVE_FSYNC )
check_symbol_exists( ftruncate "unistd.h" HAVE_FTRUNCATE )
check_symbol_exists( getpagesize "unistd.h" HAVE_GETPAGESIZE )
check_symbol_exists( gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY )
check_symbol_exists( gmtime "time.h" HAVE_GMTIME )
check_symbol_exists( gmtime_r "time.h" HAVE_GMTIME_R )
@ -165,6 +204,7 @@ check_symbol_exists( lrintf "math.h" HAVE_LRINTF )
check_symbol_exists( lround "math.h" HAVE_LROUND )
check_symbol_exists( lstat "sys/stat.h" HAVE_LSTAT )
check_symbol_exists( memcpy "string.h" HAVE_MEMCPY )
check_symbol_exists( memmove "string.h" HAVE_MEMMOVE )
check_symbol_exists( mlock "sys/mman.h" HAVE_MLOCK )
check_symbol_exists( pipe "unistd.h" HAVE_PIPE )
check_symbol_exists( posix_fadvise "fcntl.h" HAVE_POSIX_FADVISE )
@ -239,14 +279,24 @@ set( _PREFIX "${CMAKE_INSTALL_PREFIX}" )
set( _LIBDIR "${CMAKE_INSTALL_LIBDIR}/audacity" )
set( _RPATH "\$ORIGIN/../${_LIBDIR}" )
set( _DATADIR "${CMAKE_INSTALL_DATADIR}" )
set( _PKGDATA "${_DATADIR}/audacity" )
set( _PKGDATA "${_DATADIR}/audacity/" )
# Precreate the lib and lib64 directories so we can make then the same
if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib" )
file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
endif()
if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib64" )
file( CREATE_LINK "${CMAKE_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/lib64" SYMBOLIC )
endif()
# Helper to organize sources into folders for the IDEs
macro( organize_source root prefix sources )
set( cleaned )
foreach(source ${sources})
foreach( source ${sources} )
# Remove generator expressions
string( REGEX REPLACE ".*>:(.*)>" "\\1" source "${source}" )
string( REGEX REPLACE ".*>:(.*)>*" "\\1" source "${source}" )
string( REPLACE ">" "" source "${source}" )
# Remove keywords
string( REGEX REPLACE "^[A-Z]+$" "" source "${source}" )
@ -254,7 +304,7 @@ macro( organize_source root prefix sources )
# Add to cleaned
list( APPEND cleaned "${source}" )
endforeach()
# Define the source groups
if( "${prefix}" STREQUAL "" )
source_group( TREE "${root}" FILES ${cleaned} )
@ -283,30 +333,25 @@ endfunction()
# Helper to retrieve the settings returned from pkg_check_modules()
macro( get_package_interface package )
set( INCLUDES
INTERFACE
${${package}_INCLUDE_DIRS}
${${package}_INCLUDE_DIRS}
)
set( CLFAGS
INTERFACE
${${package}_CFLAGS}
${${package}_CFLAGS_OTHER}
set( COPTS
${${package}_CFLAGS}
${${package}_CFLAGS_OTHER}
)
set( LDFLAGS
INTERFACE
${${package}_LDFLAGS}
${${package}_LDFLAGS_OTHER}
set( LOPTS
${${package}_LDFLAGS}
${${package}_LDFLAGS_OTHER}
)
set( LINKDIRS
INTERFACE
${${package}_LIBRARY_DIRS}
${${package}_LIBRARY_DIRS}
)
set( LIBRARIES
INTERFACE
${${package}_LIBRARIES}
${${package}_LIBRARIES}
)
endmacro()
@ -342,4 +387,3 @@ add_subdirectory( "cmake-proxies/mod-script-pipe" )
print_properties(TARGET "Audacity")
#]]

View File

@ -23,7 +23,7 @@ option( prefer_system_libs "Use system libraries if available" YES )
#
# packages A list of packages required for this target in pkg-config
# format.
function( addlib dir name symbol required check ) #packages )
function( addlib dir name symbol required check )
# Extract the list of packages from the function args
list( SUBLIST ARGV 5 -1 packages )
@ -40,6 +40,9 @@ function( addlib dir name symbol required check ) #packages )
option( ${enable} "Enable ${name} library" ON )
endif()
# Let the Audacity target know that this library will be used.
set( USE_${symbol} ${${enable}} CACHE INTERNAL USE_${symbol} )
# Bail if the target isn't enabled.
if( NOT ${enable} )
message( STATUS "========== ${name} disabled ==========" )
@ -65,65 +68,62 @@ function( addlib dir name symbol required check ) #packages )
message( STATUS "========== Configuring ${name} ==========" )
# Let the Audacity target know that this library will be used.
set( USE_${symbol} ON CACHE INTERNAL USE_${symbol} )
# Check for the system package if the user prefers it.
if( ${system} )
# Look them up
pkg_check_modules( ${symbol} ${packages} )
if( ${symbol}_FOUND )
pkg_check_modules( ${TARGET} ${packages} )
if( ${TARGET}_FOUND )
message( STATUS "Using '${name}' system library" )
# Use the symbol name for the target to prevent a collision when
# the alias libraries are defined for the listed packages.
set( TARGET ${symbol} )
# Create the target interface library
add_library( ${TARGET} INTERFACE IMPORTED GLOBAL )
# Retrieve the package information
get_package_interface( ${symbol} )
get_package_interface( ${TARGET} )
# And add it to our target
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
target_compile_options( ${TARGET} INTERFACE ${CFLAGS} )
target_compile_options( ${TARGET} INTERFACE ${COPTS} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_options( ${TARGET} INTERFACE ${LDFLAGS} )
target_link_options( ${TARGET} INTERFACE ${LOPTS} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
# Define a library alias for each of the packages
foreach( package ${packages} )
# Convert the package spec to a list
string( REPLACE " " ";" package "${package}" )
# And extract just the package name
list( GET package 0 package )
# Create the alias
add_library( "lib${package}" ALIAS ${TARGET} )
endforeach()
# We are done...
return()
endif()
endif()
message( STATUS "Using '${name}' local library" )
# User want the local package or the system one wasn't found
if( NOT ${TARGET}_FOUND )
message( STATUS "Using '${name}' local library" )
# Pull in the target config
add_subdirectory( ${dir} EXCLUDE_FROM_ALL )
# Pull in the target config
add_subdirectory( ${dir} EXCLUDE_FROM_ALL )
# Get the list of targets defined by that config
get_property( targets DIRECTORY "${dir}" PROPERTY BUILDSYSTEM_TARGETS )
# Get the list of targets defined by that config
get_property( targets DIRECTORY "${dir}" PROPERTY BUILDSYSTEM_TARGETS )
# Set the folder (for the IDEs) for each one
foreach( target ${targets} )
# Skip interface libraries since they don't have any source to
# present in the IDEs
get_target_property( type "${target}" TYPE )
if( NOT "${type}" STREQUAL "INTERFACE_LIBRARY" )
set_target_properties( ${target} PROPERTIES FOLDER "lib-src" )
# Set the folder (for the IDEs) for each one
foreach( target ${targets} )
# Skip interface libraries since they don't have any source to
# present in the IDEs
get_target_property( type "${target}" TYPE )
if( NOT "${type}" STREQUAL "INTERFACE_LIBRARY" )
set_target_properties( ${target} PROPERTIES FOLDER "lib-src" )
endif()
endforeach()
endif()
# Define a library alias for each of the packages
foreach( package ${packages} )
# Convert the package spec to a list
string( REPLACE " " ";" package "${package}" )
# And extract just the package name
list( GET package 0 package )
# But only if the package name doesn't conflict with the
# target name.
if( NOT TARGET ${package} )
# Create the alias
add_library( "${package}" ALIAS ${TARGET} )
endif()
endforeach()
endfunction()
@ -131,11 +131,11 @@ endfunction()
# Required libraries
#
# directory option symbol req chk version
addlib( wxwidgets wxwidgets WXWIDGETS YES NO "" ) # must be first
addlib( wxWidgets wxwidgets WX YES NO "" ) # must be first
addlib( FileDialog FileDialog FILEDIALOG YES YES "" )
addlib( expat expat EXPAT YES YES "" )
addlib( lame lame LAME YES YES "lame >= 3.100" )
addlib( lib-widget-extra libextra WIDGET YES YES "" )
addlib( lib-widget-extra libextra EXTRA YES YES "" )
addlib( libsndfile sndfile SNDFILE YES YES "sndfile >= 1.0.24" )
addlib( libsoxr soxr SOXR YES YES "soxr >= 0.1.1" )
addlib( portaudio-v19 portaudio PORTAUDIO YES YES "" )
@ -148,11 +148,11 @@ addlib( libid3tag id3tag LIBID3TAG NO YES "id3tag >= 0.15.1
addlib( libmad mad LIBMAD NO YES "mad >= 2.3" )
addlib( libnyquist nyquist NYQUIST NO YES "" )
addlib( libvamp vamp VAMP NO YES "vamp >= 2.5" "vamp-hostsdk >= 2.5" )
addlib( libogg ogg LIBOGG NO YES "ogg >= 1.3.1" )
addlib( libogg ogg LIBVORBIS NO YES "ogg >= 1.3.1" )
addlib( libvorbis vorbis LIBVORBIS NO YES "vorbis >= 1.3.3" "vorbisenc >= 1.3.3" "vorbisfile >= 1.3.3" )
addlib( libflac flac LIBFLAC NO YES "flac >= 1.3.1" "flac++ >= 1.3.1" )
addlib( lv2 lv2 LV2 NO YES "lilv-0 >= 0.24.6" "lv2 >= 1.16.0" "serd-0 >= 0.30.2" "sord-0 >= 0.16.4" "sratom-0 >= 0.6.4" )
addlib( portmidi midi PORTMIDI NO YES "portmidi >= 0.1" )
addlib( portmidi midi MIDI NO YES "portmidi >= 0.1" )
addlib( portmixer portmixer PORTMIXER NO YES "" )
addlib( portsmf portsmf PORTSMF NO YES "portsmf >= 0.1" )
addlib( sbsms sbsms SBSMS NO YES "sbsms >= 2.0.2" )

View File

@ -1,12 +1,14 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/FileDialog.cpp
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/win/FileDialogPrivate.cpp>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/mac/FileDialogPrivate.mm>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/gtk/FileDialogPrivate.cpp>
$<$<BOOL:${wxIS_WIN}>:${TARGET_ROOT}/win/FileDialogPrivate.cpp>
$<$<BOOL:${wxIS_MAC}>:${TARGET_ROOT}/mac/FileDialogPrivate.mm>
$<$<BOOL:${wxIS_GTK}>:${TARGET_ROOT}/gtk/FileDialogPrivate.cpp>
)
list( APPEND INCLUDES
@ -21,16 +23,15 @@ list( APPEND DEFINES
list( APPEND OPTIONS
PRIVATE
$<$<PLATFORM_ID:Windows>:/permissive->
$<$<PLATFORM_ID:Darwin>:-Wno-deprecated-declarations>
$<$<PLATFORM_ID:Linux>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-deprecated-declarations>
)
list( APPEND LIBRARIES
PRIVATE
wxwidgets
wxWidgets
PUBLIC
$<$<PLATFORM_ID:Linux>:PkgConfig::GTK>
$<$<BOOL:${wxIS_GTK}>:PkgConfig::GTK>
)
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/lib/xmlparse.c
@ -12,7 +14,7 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
PUBLIC
${TARGET_ROOT}/lib
)
@ -22,10 +24,6 @@ list( APPEND DEFINES
HAVE_EXPAT_CONFIG_H
)
check_symbol_exists( "getpagesize" "unistd.h" HAVE_GETPAGESIZE )
check_symbol_exists( "bcopy" "strings.h" HAVE_BCOPY )
check_symbol_exists( "memmove" "string.h" HAVE_MEMMOVE )
if( WORDS_BIGENDIAN )
set( BYTEORDER 4321 )
else( WORDS_BIGENDIAN )

View File

@ -1,6 +1,7 @@
# Add our target and all of it's aliases
add_library( ${TARGET} INTERFACE )
add_library( ${symbol} ALIAS ${TARGET} )
add_library( libavcodec ALIAS ${TARGET} )
add_library( libavformat ALIAS ${TARGET} )
add_library( libavutil ALIAS ${TARGET} )
@ -8,35 +9,35 @@ add_library( libavutil ALIAS ${TARGET} )
# Pull in standard variables
def_vars()
message( STATUS "========== Configuring ${TARGET} ==========" )
message( STATUS "========== Configuring ${name} ==========" )
# Let the Audacity target know we're using ffmpeg
set( USE_FFMPEG ON CACHE INTERNAL USE_FFMPEG )
set( USE_${symbol} ON CACHE INTERNAL USE_${symbol} )
# Add the system/local option
option( use_system_${TARGET} "Use ${TARGET} system library if available" ${prefer_system_libs} )
option( use_system_${name} "Use ${name} system library if available" ${prefer_system_libs} )
# Look up the system packages if the user wants them
if( use_system_${TARGET} )
if( use_system_${name} )
# Provide an option that determines if the libraries are loaded
# dynamically at run time or statically link to at build time
option( disable_dynamic_loading "Disable dynamic loading of ${TARGET} libraries" NO)
# dynamically at run time or statically linked at build time
option( disable_dynamic_${name} "Disable dynamic loading of ${name} libraries" NO)
# Look them up
pkg_check_modules( ${TARGET} ${packages} )
else()
# Make sure to reset in case user reconfigures between local/system
set( disable_dynamic_loading NO CACHE INTERNAL "" )
set( disable_dynamic_${name} NO CACHE INTERNAL "" )
endif()
# If the system packages were found
if( ${TARGET}_FOUND )
message( STATUS "Using '${TARGET}' system library" )
message( STATUS "Using '${name}' system library" )
# Pull in the package settings
get_package_interface( ${TARGET} )
else()
message( STATUS "Using '${TARGET}' local library" )
message( STATUS "Using '${name}' local library" )
# Otherwise define the local settings
list( APPEND INCLUDES
@ -47,8 +48,8 @@ endif()
# And add the settings to the target
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
target_compile_options( ${TARGET} INTERFACE ${CFLAGS} )
target_compile_options( ${TARGET} INTERFACE ${COPTS} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_options( ${TARGET} INTERFACE ${LDFLAGS} )
target_link_options( ${TARGET} INTERFACE ${LOPTS} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
# libmp3lame
@ -39,11 +41,11 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
${TARGET_ROOT}/../libmp3lame
${TARGET_ROOT}/../mpglib
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/public
${_PUBDIR}
)
list( APPEND DEFINES

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/NonGuiThread.cpp
@ -13,7 +15,7 @@ list( APPEND INCLUDES
list( APPEND LIBRARIES
PRIVATE
wxwidgets
wxWidgets
)
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )

View File

@ -1,7 +1,11 @@
# FIXME: Once switch to cmake is made, remove Windows pragmas
# from AudacityApp.cpp and change target name to "flac/flac++"
add_library( ${TARGET} STATIC )
add_library( ${TARGET}++ STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
@ -48,7 +52,7 @@ list( APPEND SOURCES++
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
${TARGET_ROOT}/src/libFLAC/include
PUBLIC
${TARGET_ROOT}/include
@ -62,8 +66,9 @@ list( APPEND DEFINES
)
list( APPEND LIBRARIES
PRIVATE
PUBLIC
libogg
libflac++
)
list( APPEND LIBRARIES++
@ -72,7 +77,7 @@ list( APPEND LIBRARIES++
)
set( CPU_IS_BIG_ENDIAN ${WORDS_BIGENDIAN} )
set( CPU_IS_LITTLE_ENDIAN NOT ${WORDS_BIGENDIAN} )
set( CPU_IS_LITTLE_ENDIAN !${WORDS_BIGENDIAN} )
set( FLAC__HAS_OGG 1 )
@ -83,16 +88,12 @@ configure_file( config.h.in private/config.h )
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_compile_features( ${TARGET} PRIVATE ${FEATURES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )
organize_source( "${TARGET_ROOT}" "" "${SOURCES++}" )
target_sources( ${TARGET}++ PRIVATE ${SOURCES++} )
target_compile_definitions( ${TARGET}++ PRIVATE ${DEFINES} )
target_compile_features( ${TARGET}++ PRIVATE ${FEATURES} )
target_compile_options( ${TARGET}++ PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET}++ PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET}++ PRIVATE ${LIBRARIES++} )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/compat.c
@ -23,7 +25,7 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
$<$<PLATFORM_ID:Windows>:$ENV{WXWIN}/src/zlib>
PUBLIC
${TARGET_ROOT}
@ -31,18 +33,18 @@ list( APPEND INCLUDES
list( APPEND OPTIONS
PRIVATE
$<$<C_COMPILER_ID:GNU>:-Wno-implicit-function-declaration>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-implicit-function-declaration>
)
list( APPEND LIBRARIES
PRIVATE
wxwidgets
wxWidgets
)
configure_file( config.h.in private/config.h )
organize_source( "${TARGET_ROOT}" "src" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/bit.c
@ -18,9 +20,9 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/public
${_PUBDIR}
${TARGET_ROOT}
)
@ -34,13 +36,12 @@ list( APPEND DEFINES
list( APPEND OPTIONS
PRIVATE
$<$<IN_LIST:${CMAKE_C_COMPILER_ID},GNU;Clang;AppleClang>:-Wall>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wall>
)
configure_file( config.h.in private/config.h )
set( FPM FPM_DEFAULT )
configure_file( config.h.in private/config.h )
configure_file( mad.h.in public/mad.h )
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
# libnyquist
@ -270,11 +272,8 @@ list( APPEND INCLUDES
${TARGET_ROOT}/nyquist/nyqstk/include
${TARGET_ROOT}/nyquist/tran
${TARGET_ROOT}/nyquist/xlisp
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/nyquist/sys/unix>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/nyquist/sys/unix>
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/nyquist/sys/win/msvc>
$<$<BOOL:${UNIX}>:${TARGET_ROOT}/nyquist/sys/unix>
$<$<NOT:$<BOOL:${UNIX}>>:${TARGET_ROOT}/nyquist/sys/win/msvc>
PUBLIC
${TARGET_ROOT}
)
@ -283,7 +282,7 @@ list( APPEND DEFINES
PRIVATE
CMTSTUFF
EXT
$<$<PLATFORM_ID:Windows>:_LIB WIN32 D_LIB>
$<$<PLATFORM_ID:Windows>:WIN32>
)
list( APPEND OPTIONS

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/bitwise.c
@ -9,7 +11,7 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/public
${_PUBDIR}
${TARGET_ROOT}/include
)

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/audioreader.cpp

View File

@ -100,13 +100,11 @@ list( APPEND OPTIONS
$<$<C_COMPILER_ID:MSVC>:/wd4996>
)
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
cmake_push_check_state(RESET)
if( CMAKE_C_COMPILER_ID MATCHES "MSVC" )
cmake_push_check_state( RESET )
set( CMAKE_EXTRA_INCLUDE_FILES "BaseTsd.h" )
check_type_size( "SSIZE_T" SIZEOF_SSIZE LANGUAGE C )
list( APPEND DEFINES
ssize_t=SSIZE_T
)
list( APPEND DEFINES ssize_t=SSIZE_T )
cmake_pop_check_state()
else()
check_type_size( "ssize_t" SIZEOF_SSIZE LANGUAGE C )
@ -138,7 +136,7 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
endif()
set( CPU_IS_BIG_ENDIAN ${WORDS_BIGENDIAN} )
set( CPU_IS_LITTLE_ENDIAN NOT ${WORDS_BIGENDIAN} )
set( CPU_IS_LITTLE_ENDIAN !${WORDS_BIGENDIAN} )
set( HAVE_EXTERNAL_LIBS 0 )
set( VERSION "1.0.24" )
@ -149,7 +147,7 @@ set( PACKAGE_VERSION ${VERSION} )
# Does compiler support "flexible array members"
try_compile( HAVE_FLEXIBLE_ARRAY
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/famcheck.c
${_SRCDIR}/famcheck.c
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
OUTPUT_VARIABLE c_out
)
@ -157,7 +155,7 @@ try_compile( HAVE_FLEXIBLE_ARRAY
# Determine how the CPU clips when doing float to int conversions
try_run( r_rc c_rc
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/clipcheck.c
${_SRCDIR}/clipcheck.c
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
RUN_OUTPUT_VARIABLE r_out
COMPILE_OUTPUT_VARIABLE c_out
@ -165,7 +163,7 @@ try_run( r_rc c_rc
if( NOT c_rc )
message( STATUS "${c_out}" )
message( FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/clipcheck.c compile failed:" )
message( FATAL_ERROR "${_SRCDIR}/clipcheck.c compile failed:" )
endif()
list( GET r_out 0 CPU_CLIPS_POSITIVE )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
set(CMAKE_MODULE_PATH ${TARGET_ROOT}/cmake/Modules )
list( APPEND SOURCES
@ -26,7 +28,7 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
PUBLIC
${TARGET_ROOT}/src
)
@ -40,20 +42,21 @@ list( APPEND DEFINES
list( APPEND OPTIONS
PRIVATE
$<$<IN_LIST:${CMAKE_C_COMPILER_ID},GNU;Clang;AppleClang>:-Wall>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:
-Wconversion
-Wall
-Wextra
-pedantic
-Wundef
-Wpointer-arith
-Wno-long-long
-Wnested-externs
-Wmissing-prototypes
-Wstrict-prototypes
>
$<$<C_COMPILER_ID:AppleClang,Clang>:-Wno-keyword-macro>
)
if( CMAKE_C_COMPILER_ID MATCHES "GNU|.*Clang" )
list( APPEND OPTIONS
PRIVATE
-Wconversion -Wall -Wextra -pedantic -Wundef -Wpointer-arith -Wno-long-long
$<$<C_COMPILER_ID:Clang>:-Wno-keyword-macro>
$<$<COMPILE_LANGUAGE:CXX>:
-std=gnu89 -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes
>
)
endif()
set( HAVE_BIGENDIAN ${WORDS_BIGENDIAN} )
set( AVCODEC_FOUND NO )
@ -61,21 +64,22 @@ set( AVUTIL_FOUND NO )
set( WITH_PFFFT YES )
set( WITH_CR32 YES )
set( WITH_CR32S YES )
set( WITH_CR32S NO )
set( WITH_CR64 YES )
set( WITH_CR64S YES )
set( WITH_CR64S NO )
set( WITH_VR32 YES )
# Copied from libsoxr CMakeLists.txt
if( WITH_CR32S )
find_package( SIMD32 )
set( WITH_CR32S ${SIMD32_FOUND} )
# list( APPEND OPTIONS ${SIMD32_C_FLAGS} )
find_package( SIMD32 )
if( SIMD32_FOUND )
set( WITH_CR32S ON )
string( STRIP "${SIMD32_C_FLAGS}" SIMD32_C_FLAGS )
list( APPEND OPTIONS ${SIMD32_C_FLAGS} )
endif()
if( WITH_CR64S )
find_package( SIMD64 )
set( WITH_CR64S ${SIMD64_FOUND} )
find_package( SIMD64 )
if( SIMD64_FOUND )
set( WITH_CR64S ON )
string( STRIP "${SIMD64_C_FLAGS}" SIMD64_C_FLAGS )
list( APPEND OPTIONS ${SIMD64_C_FLAGS} )
endif()

View File

@ -2,6 +2,8 @@
add_library( ${TARGET} STATIC )
add_library( ${TARGET}-hostsdk ALIAS ${TARGET} )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/vamp-hostsdk/PluginBufferingAdapter.cpp

View File

@ -3,6 +3,8 @@ add_library( ${TARGET} STATIC )
add_library( ${TARGET}enc ALIAS ${TARGET} )
add_library( ${TARGET}file ALIAS ${TARGET} )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/lib/analysis.c
@ -31,9 +33,8 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
${TARGET_ROOT}/lib
${LIBOGG_INCLUDES}
PUBLIC
${TARGET_ROOT}/include
)

View File

@ -166,13 +166,13 @@ macro( bld name packages define sources )
break()
endif()
list( APPEND libs PRIVATE
"PkgConfig::${pkg}"
list( APPEND libs
PRIVATE
"PkgConfig::${pkg}"
)
endforeach()
if( NOT missing )
list( APPEND DEFINES
PRIVATE
${define}
@ -199,8 +199,8 @@ if( WIN32 )
set( LILV_DIR_SEP "\\\\" )
set( LILV_DEFAULT_LV2_PATH "%APPDATA%\\LV2;%COMMONPROGRAMFILES%\\LV2" )
set( SUIL_MODULE_DIR "C:\\Windows\\System32" )
set( SUIL_DIR_SEP "\\\\" )
set( SUIL_MODULE_DIR "" )
set( SUIL_DIR_SEP "" )
set( SUIL_GTK2_LIB_NAME "libgtk-x11-2.0.so.0" )
set( SUIL_GTK3_LIB_NAME "libgtk-x11-3.0.so.0" )
set( SUIL_MODULE_PREFIX "" )
@ -210,8 +210,8 @@ elseif( APPLE )
set( LILV_DIR_SEP "/" )
set( LILV_DEFAULT_LV2_PATH "~/Library/Audio/Plug-Ins/LV2:~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2:/Library/Audio/Plug-Ins/LV2" )
set( SUIL_MODULE_DIR "/usr/local/lib/suil-0" )
set( SUIL_DIR_SEP "/" )
set( SUIL_MODULE_DIR "" )
set( SUIL_DIR_SEP "" )
set( SUIL_GTK2_LIB_NAME "libgtk-x11-2.0.so.0" )
set( SUIL_GTK3_LIB_NAME "libgtk-x11-3.0.so.0" )
set( SUIL_MODULE_PREFIX "lib" )
@ -221,8 +221,8 @@ elseif( UNIX )
set( LILV_DIR_SEP "/" )
set( LILV_DEFAULT_LV2_PATH "~/.lv2:/usr/lib/lv2:/usr/local/lib/lv2" )
set( SUIL_MODULE_DIR "/usr/local/lib/suil-0" )
set( SUIL_DIR_SEP "/" )
set( SUIL_MODULE_DIR "" )
set( SUIL_DIR_SEP "" )
set( SUIL_GTK2_LIB_NAME "libgtk-x11-2.0.so.0" )
set( SUIL_GTK3_LIB_NAME "libgtk-x11-3.0.so.0" )
set( SUIL_MODULE_PREFIX "lib" )
@ -269,7 +269,7 @@ configure_file( sratom_config.h.in "${_PRVDIR}/sratom_config.h" )
configure_file( suil_config.h.in "${_PRVDIR}/suil_config.h" )
organize_source( "${TARGET_ROOT}" "" "${SOURCES} ${HEADERS}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} ${HEADERS} )# ${stamp} )
target_sources( ${TARGET} PRIVATE ${SOURCES} ${HEADERS} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )

View File

@ -24,7 +24,7 @@ list( APPEND LIBRARIES
Audacity
libnyquist
portaudio-v19
wxwidgets
wxWidgets
)
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" )

View File

@ -26,8 +26,8 @@ list( APPEND DEFINES
list( APPEND LIBRARIES
PRIVATE
wxwidgets
Audacity
wxWidgets
)
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" )

View File

@ -1,6 +1,62 @@
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" )
option( use_pa_ds "Enable the portaudio DirectSound interface if available" YES )
option( use_pa_wasapi "Enable the portaudio WASAPI interface if available" YES )
option( use_pa_wmme "Enable the portaudio WMME interface if available" YES )
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
option( use_pa_coreaudio "Enable the portaudio CoreAudio interface if available" YES )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
option( use_pa_alsa "Enable the portaudio ALSA interface if available" YES )
if( use_pa_alsa )
find_package( ALSA )
if( NOT ALSA_FOUND )
set( use_pa_alsa NO CACHE INTERNAL "" )
endif()
endif()
endif()
# Look for OSS if the user wants it
option( use_pa_oss "Use the OSS audio interface if available" YES )
if( use_pa_oss )
find_path( OSS_INCLUDE NAMES sys/soundcard.h )
if( OSS_INCLUDE )
set( OSS_INCLUDE_DIRS ${OSS_INCLUDE} )
endif()
find_library( OSS_LIBRARY NAMES ossaudio )
if( OSS_LIBRARY )
set( OSS_LIBRARIES ${OSS_LIBRARY} )
endif()
if( NOT OSS_INCLUDE_DIRS )
set( use_pa_oss NO CACHE INTERNAL "" )
endif()
endif()
# Look for JACK if the user wants it
option( use_pa_jack "Use the JACK audio interface if available" YES )
if( use_pa_jack )
# Provide an option that determines if the libraries are loaded
# dynamically at run time or statically linked at build time
option( disable_dynamic_jack "Disable dynamic loading of JACK libraries" YES )
# Find it
find_package( Jack )
if( NOT JACK_FOUND)
set( use_pa_jack NO CACHE INTERNAL "" )
endif()
else()
# Make sure to reset in case user reconfigures later
set( disable_dynamic_jack NO CACHE INTERNAL "" )
endif()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/common/pa_allocation.c
@ -14,130 +70,141 @@ list( APPEND SOURCES
${TARGET_ROOT}/src/common/pa_ringbuffer.c
${TARGET_ROOT}/src/common/pa_stream.c
${TARGET_ROOT}/src/common/pa_trace.c
)
list( APPEND INCLUDES
PRIVATE
${TARGET_ROOT}/src/common
PUBLIC
${TARGET_ROOT}/include
)
if( WIN32 )
list( APPEND DEFINES
PUBLIC
PA_USE_DS=1
PA_USE_WASAPI=1
PA_USE_WMME=1
)
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/hostapi/dsound/pa_win_ds.c
${TARGET_ROOT}/src/hostapi/dsound/pa_win_ds_dynlink.c
${TARGET_ROOT}/src/hostapi/wasapi/pa_win_wasapi.c
${TARGET_ROOT}/src/hostapi/wmme/pa_win_wmme.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
)
>
list( APPEND INCLUDES
PRIVATE
${TARGET_ROOT}/src/hostapi/dsound
${TARGET_ROOT}/src/os/win
)
elseif( APPLE )
list( APPEND DEFINES
PUBLIC
PA_USE_COREAUDIO=1
)
list( APPEND SOURCES
PRIVATE
$<$<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
)
>
list( APPEND INCLUDES
PRIVATE
${TARGET_ROOT}/src/hostapi/coreaudio
${TARGET_ROOT}/src/os/unix
)
$<$<BOOL:${use_pa_ds}>:
${TARGET_ROOT}/src/hostapi/dsound/pa_win_ds.c
${TARGET_ROOT}/src/hostapi/dsound/pa_win_ds_dynlink.c
>
list( APPEND LIBRARIES
INTERFACE
"-framework CoreAudio"
)
elseif( UNIX )
find_package(ALSA)
if( ALSA_FOUND )
list( APPEND DEFINES
PUBLIC
PA_USE_ALSA=1
)
$<$<BOOL:${use_pa_wasapi}>:
${TARGET_ROOT}/src/hostapi/wasapi/pa_win_wasapi.c
>
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/hostapi/alsa/pa_linux_alsa.c
)
$<$<BOOL:${use_pa_wmme}>:
${TARGET_ROOT}/src/hostapi/wmme/pa_win_wmme.c
>
list( APPEND INCLUDES
PRIVATE
${ALSA_INCLUDE_DIRS}
)
$<$<BOOL:${use_pa_alsa}>:
${TARGET_ROOT}/src/hostapi/alsa/pa_linux_alsa.c
>
list( APPEND LIBRARIES
INTERFACE
${ALSA_LIBRARIES}
)
endif()
$<$<BOOL:${use_pa_oss}>:
${TARGET_ROOT}/src/hostapi/oss/pa_unix_oss.c
>
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/os/unix/pa_unix_hostapis.c
${TARGET_ROOT}/src/os/unix/pa_unix_util.c
)
list( APPEND INCLUDES
PRIVATE
${TARGET_ROOT}/src/os/unix
)
endif()
set( CMAKE_MODULE_PATH ${TARGET_ROOT}/cmake_support )
find_package(Jack)
if( JACK_FOUND )
list( APPEND DEFINES
PUBLIC
PA_USE_JACK=1
)
list( APPEND SOURCES
PRIVATE
$<$<BOOL:${use_pa_jack}>:
${TARGET_ROOT}/src/hostapi/jack/pa_jack.c
${TARGET_ROOT}/src/hostapi/jack/pa_jack_dynload.c
)
>
)
list( APPEND INCLUDES
PRIVATE
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:${use_pa_ds}>:
${TARGET_ROOT}/src/hostapi/dsound
>
$<$<BOOL:${use_pa_coreaudio}>:
${TARGET_ROOT}/src/hostapi/coreaudio
>
$<$<BOOL:${use_pa_alsa}>:
${ALSA_INCLUDE_DIRS}
>
$<$<BOOL:${use_pa_oss}>:
${OSS_INCLUDE_DIRS}
>
$<$<BOOL:${use_pa_jack}>:
${TARGET_ROOT}/src/hostapi/jack
${JACK_INCLUDE_DIRS}
)
${JACK_INCLUDE_DIRS}
>
list( APPEND LIBRARIES
INTERFACE
PUBLIC
${TARGET_ROOT}/include
)
list( APPEND DEFINES
PUBLIC
$<$<BOOL:${use_pa_ds}>:
PA_USE_DS=1
>
$<$<BOOL:${use_pa_wasapi}>:
PA_USE_WASAPI=1
>
$<$<BOOL:${use_pa_wmme}>:
PA_USE_WMME=1
>
$<$<BOOL:${use_pa_coreaudio}>:
PA_USE_COREAUDIO=1
>
$<$<BOOL:${use_pa_alsa}>:
PA_USE_ALSA=1
>
$<$<BOOL:${use_pa_oss}>:
PA_USE_OSS=1
HAVE_SYS_SOUNDCARD_H=1
>
$<$<BOOL:${use_pa_jack}>:
PA_USE_JACK=1
>
$<$<NOT:$<BOOL:${disable_dynamic_jack}>>:
PA_DYNAMIC_JACK=1
>
)
list( APPEND LIBRARIES
INTERFACE
$<$<BOOL:${use_pa_alsa}>:
${ALSA_LIBRARIES}
>
$<$<BOOL:${use_pa_oss}>:
${OSS_LIBRARIES}
>
$<$<BOOL:${use_pa_jack}>:
${JACK_LIBRARIES}
)
endif()
>
)
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )

View File

@ -1,51 +1,87 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/pm_common/portmidi.c
${TARGET_ROOT}/pm_common/pmutil.c
${TARGET_ROOT}/porttime/porttime.c
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/pm_win/pmwin.c>
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/pm_win/pmwinmm.c>
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/porttime/ptwinmm.c>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/finddefault.c>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/pmmac.c>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/pmmacosxcm.c>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/readbinaryplist.c>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/porttime/ptmacosx_mach.c>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux/finddefault.c>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux/pmlinux.c>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux/pmlinuxalsa.c>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/porttime/ptlinux.c>
$<$<PLATFORM_ID:Windows>:
${TARGET_ROOT}/pm_win/pmwin.c
${TARGET_ROOT}/pm_win/pmwinmm.c
${TARGET_ROOT}/porttime/ptwinmm.c
>
$<$<PLATFORM_ID:Darwin>:
${TARGET_ROOT}/pm_mac/finddefault.c
${TARGET_ROOT}/pm_mac/pmmac.c
${TARGET_ROOT}/pm_mac/pmmacosxcm.c
${TARGET_ROOT}/pm_mac/readbinaryplist.c
${TARGET_ROOT}/porttime/ptmacosx_mach.c
>
$<$<PLATFORM_ID:Linux,FreeBSD>:
${TARGET_ROOT}/pm_linux/finddefault.c
${TARGET_ROOT}/pm_linux/pmlinux.c
${TARGET_ROOT}/porttime/ptlinux.c
>
$<$<BOOL:${ALSA_FOUND}>:
${TARGET_ROOT}/pm_linux/pmlinuxalsa.c
>
)
list( APPEND INCLUDES
PRIVATE
${TARGET_ROOT}/pm_common
${TARGET_ROOT}/porttime
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/pm_win>
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux>
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_win>
$<$<PLATFORM_ID:Windows>:
${TARGET_ROOT}/pm_win
>
$<$<PLATFORM_ID:Darwin>:
${TARGET_ROOT}/pm_mac
>
$<$<PLATFORM_ID:Linux,FreeBSD>:
${TARGET_ROOT}/pm_linux
>
)
list( APPEND DEFINES
PRIVATE
$<$<PLATFORM_ID:Linux>:PMALSA=1>
$<$<BOOL:${ALSA_FOUND}>:
PMALSA=1
>
)
list( APPEND OPTIONS
PRIVATE
$<$<PLATFORM_ID:Linux>:
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:
-Wno-pointer-to-int-cast
-Wno-int-to-pointer-cast
-Wno-implicit-function-declaration
>
)
list( APPEND LIBRARIES
PUBLIC
$<$<PLATFORM_ID:Darwin>:
"-framework CoreMIDI"
>
$<$<PLATFORM_ID:FreeBSD>:
compat
>
)
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )

View File

@ -1,19 +1,39 @@
add_library( ${TARGET} STATIC )
get_target_property( PA_DEFS portaudio-v19 COMPILE_DEFINITIONS )
string( REPLACE ";" " " PA_DEFS "${PA_DEFS}" )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/px_mixer.c
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/src/px_win_common.c>
$<$<IN_LIST:PA_USE_DS=1,${PA_DEFS}>:${TARGET_ROOT}/src/px_win_ds.c>
$<$<IN_LIST:PA_USE_WASAPI=1,${PA_DEFS}>:${TARGET_ROOT}/src/px_win_wasapi.c>
$<$<IN_LIST:PA_USE_WMME=1,${PA_DEFS}>:${TARGET_ROOT}/src/px_win_wmme.c>
$<$<IN_LIST:PA_USE_COREAUDIO=1,${PA_DEFS}>:${TARGET_ROOT}/src/px_mac_coreaudio.c>
$<$<IN_LIST:PA_USE_ALSA=1,${PA_DEFS}>:${TARGET_ROOT}/src/px_linux_alsa.c>
$<$<IN_LIST:PA_USE_OSS=1,${PA_DEFS}>:${TARGET_ROOT}/src/px_unix_oss.c>
$<$<PLATFORM_ID:Windows>:
${TARGET_ROOT}/src/px_win_common.c
>
$<$<BOOL:${use_pa_ds}>:
${TARGET_ROOT}/src/px_win_ds.c
>
$<$<BOOL:${use_pa_wasapi}>:
${TARGET_ROOT}/src/px_win_wasapi.c
${TARGET_ROOT}/src/px_win_endpoint.c
>
$<$<BOOL:${use_pa_wmme}>:
${TARGET_ROOT}/src/px_win_wmme.c
>
$<$<BOOL:${use_pa_coreaudio}>:
${TARGET_ROOT}/src/px_mac_coreaudio.c
>
$<$<BOOL:${use_pa_alsa}>:
${TARGET_ROOT}/src/px_linux_alsa.c
>
$<$<BOOL:${use_pa_oss}>:
${TARGET_ROOT}/src/px_unix_oss.c
>
)
list( APPEND INCLUDES
@ -25,12 +45,29 @@ list( APPEND INCLUDES
list( APPEND DEFINES
PRIVATE
$<$<IN_LIST:PA_USE_DS=1,${PA_DEFS}>:PX_USE_WIN_DSOUND=1>
$<$<IN_LIST:PA_USE_WASAPI=1,${PA_DEFS}>:PX_USE_WIN_WASAPI=1>
$<$<IN_LIST:PA_USE_WMME=1,${PA_DEFS}>:PX_USE_WIN_MME=1>
$<$<IN_LIST:PA_USE_COREAUDIO=1,${PA_DEFS}>:PX_USE_MAC_COREAUDIO=1>
$<$<IN_LIST:PA_USE_ALSA=1,${PA_DEFS}>:PX_USE_LINUX_ALSA=1>
$<$<IN_LIST:PA_USE_OSS=1,${PA_DEFS}>:PX_USE_UNIX_OSS=1>
$<$<BOOL:${use_pa_ds}>:
PX_USE_WIN_DSOUND=1
>
$<$<BOOL:${use_pa_wasapi}>:
PX_USE_WIN_WASAPI=1
>
$<$<BOOL:${use_pa_wmme}>:
PX_USE_WIN_MME=1
>
$<$<BOOL:${use_pa_coreaudio}>:
PX_USE_MAC_COREAUDIO=1
>
$<$<BOOL:${use_pa_alsa}>:
PX_USE_LINUX_ALSA=1
>
$<$<BOOL:${use_pa_oss}>:
PX_USE_UNIX_OSS=1
>
)
list( APPEND LIBRARIES

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/allegro.cpp

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/src/buffer.cpp
@ -18,15 +20,14 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
PUBLIC
${TARGET_ROOT}/include
)
list( APPEND OPTIONS
PRIVATE
$<$<C_COMPILER_ID:CLANG>:-Wno-enum-compare>
$<$<C_COMPILER_ID:GNU>:-Wno-enum-compare>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-enum-compare>
)
find_package( Threads )
@ -34,14 +35,7 @@ if( Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
set( MULTITHREADED 1 )
endif()
if( UNIX )
check_cxx_compiler_flag( "-msse" ENABLE_SSE )
if( ENABLE_SSE )
list( APPEND OPTIONS
PRIVATE -msse
)
endif()
endif()
set( ENABLE_SSE ${HAVE_SSE} )
configure_file( config.h.in private/config.h )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/source/SoundTouch/AAFilter.cpp
@ -16,28 +18,15 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/public
${_PUBDIR}
${TARGET_ROOT}/include
)
if( UNIX )
check_cxx_compiler_flag( "-mmmx" HAVE_MMX )
if( HAVE_MMX )
list( APPEND OPTIONS
PRIVATE
-mmmx
)
endif()
check_cxx_compiler_flag( "-msse" HAVE_SSE )
if( HAVE_SSE )
list( APPEND OPTIONS
PRIVATE
-msse
)
endif()
endif()
list( APPEND OPTIONS
PRIVATE
${MMX_FLAG}
${SSE_FLAG}
)
configure_file( soundtouch_config.h.in public/soundtouch_config.h )

View File

@ -1,6 +1,8 @@
add_library( ${TARGET} STATIC )
def_vars()
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/libtwolame/ath.c
@ -26,7 +28,7 @@ list( APPEND SOURCES
list( APPEND INCLUDES
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/private
${_PRVDIR}
PUBLIC
${TARGET_ROOT}/libtwolame
)
@ -38,7 +40,7 @@ list( APPEND DEFINES
list( APPEND OPTIONS
PRIVATE
$<$<C_COMPILER_ID:GNU>:-Wno-implicit-function-declaration>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-implicit-function-declaration>
)
set( PACKAGE_BUGREPORT "twolame-discuss@lists.sourceforge.net" )

View File

@ -1,17 +1,18 @@
add_library( ${TARGET} INTERFACE )
add_library( ${symbol} ALIAS ${TARGET} )
def_vars()
message( STATUS "========== Configuring ${TARGET} ==========" )
message( STATUS "========== Configuring ${name} ==========" )
option( use_system_wxwidgets "Use ${TARGET} system library if available" ${prefer_system_libs} )
if( use_system_wxwidgets )
option( use_system_${name} "Use ${name} system library if available" ${prefer_system_libs} )
if( use_system_${name} )
find_package(wxWidgets)
endif()
if( wxWidgets_FOUND )
message( STATUS "Using '${TARGET}' system library" )
message( STATUS "Using '${name}' system library" )
if( wxWidgets_INCLUDE_DIRS_NO_SYSTEM )
set( INCLUDES
@ -28,25 +29,31 @@ if( wxWidgets_FOUND )
set( DEFINES
INTERFACE
${wxWidgets_DEFINITIONS}
$<$<CONFIG:Debug>:${wxWidgets_DEFINITIONS_DEBUG}>
$<$<CONFIG:Debug>:
${wxWidgets_DEFINITIONS_DEBUG}
>
)
set( LINKDIRS
INTERFACE
$<$<PLATFORM_ID:Windows>:${wxWidgets_LIB_DIR}>
$<$<PLATFORM_ID:Windows>:
${wxWidgets_LIB_DIR}
>
)
set( LIBRARIES
INTERFACE
${wxWidgets_LIBRARIES}
$<$<NOT:$<PLATFORM_ID:Windows>>:z>
$<$<NOT:$<PLATFORM_ID:Windows>>:
z
>
)
set( toolkit "${wxWidgets_LIBRARIES}" )
else()
message( STATUS "Using '${TARGET}' system library" )
message( STATUS "Using local '${name}' library" )
set( use_system_wxwidgets OFF CACHE BOOL "Prefer wxWidgets system library if available" FORCE )
set( use_system_${name} OFF CACHE BOOL "Prefer ${name} system library if available" FORCE )
set( WXWIN $ENV{WXWIN} )
if( "${WXWIN}" STREQUAL "" )
@ -83,7 +90,7 @@ else()
# Causes problems on OSX, so turn it off
set( wxBUILD_PRECOMP NO )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
# Doesn't yet have accessbility
set( wxUSE_ACCESSIBILITY NO )
@ -101,13 +108,18 @@ else()
set_dir_folder( ${WXWIN} "wxWidgets" )
set( INCLUDES
$<$<STREQUAL:"${wxUSE_ZLIB}","builtin">:${WXWIN}/src/zlib>
$<$<STREQUAL:"${wxUSE_ZLIB}","builtin">:
${WXWIN}/src/zlib
>
)
set( DEFINES
WXUSINGDLL
)
# Do NOT split the generator expressions across multiple lines here.
# CMake appears to have a bug and doesn't see to handle it correctly
# for target link libraries.
set( LIBRARIES
adv
base
@ -129,26 +141,37 @@ else()
# since wxRegex compile defines do not include __WXOSX_COCOA__. So,
# add it here.
target_compile_definitions( wxregex PRIVATE "__WXOSX_COCOA__" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
set( toolkit "${wxBUILD_TOOLKIT}" )
endif()
set( toolkit "${wxBUILD_TOOLKIT}" )
endif()
if( CMAKE_SYSTEM_NAME MATCHES "Linux" )
# We need the system GTK/GLIB packages
if( "${toolkit}" MATCHES ".*gtk2.*" )
set( gtk gtk+-2.0 )
set( glib glib-2.0 )
elseif( "${toolkit}" MATCHES ".*gtk3.*" )
set( gtk gtk+-3.0 )
set( glib glib-2.0 )
elseif( "${toolkit}" MATCHES ".*gtk4.*" )
set( gtk gtk+-4.0 )
set( glib glib-2.0 )
else()
message( FATAL_ERROR "Unrecognized wxGTK version: ${wxBUILD_TOOLKIT}" )
endif()
if( "${toolkit}" MATCHES ".*gtk2.*" )
set( gtk gtk+-2.0 )
set( glib glib-2.0 )
set( wxTOOLKIT "GTK2" CACHE INTERNAL "" )
set( wxIS_GTK YES CACHE INTERNAL "" )
elseif( "${toolkit}" MATCHES ".*gtk3.*" )
set( gtk gtk+-3.0 )
set( glib glib-2.0 )
set( wxTOOLKIT "GTK3" CACHE INTERNAL "" )
set( wxIS_GTK YES CACHE INTERNAL "" )
elseif( "${toolkit}" MATCHES ".*gtk4.*" )
set( gtk gtk+-4.0 )
set( glib glib-2.0 )
set( wxTOOLKIT "GTK4" CACHE INTERNAL "" )
set( wxIS_GTK YES CACHE INTERNAL "" )
elseif( "${toolkit}" MATCHES ".*msw.*" )
set( wxTOOLKIT "MSW" CACHE INTERNAL "" )
set( wxIS_WIN YES CACHE INTERNAL "" )
elseif( "${toolkit}" MATCHES ".*osx.*" )
set( wxTOOLKIT "MAC" CACHE INTERNAL "" )
set( wxIS_MAC YES CACHE INTERNAL "" )
else()
message( FATAL_ERROR "Unrecognized wxWidgets toolkit" )
endif()
if( "${wxTOOLKIT}" MATCHES "GTK." )
pkg_check_modules( GTK REQUIRED IMPORTED_TARGET GLOBAL ${gtk} )
pkg_check_modules( GLIB REQUIRED IMPORTED_TARGET GLOBAL ${glib} )
endif()
@ -158,3 +181,4 @@ target_compile_definitions( ${TARGET} INTERFACE ${DEFINES} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
INSTALL( TARGETS ${TARGET} DESTINATION ${_LIBDIR} )

View File

@ -130,7 +130,7 @@ endif()
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
set( locale "${_DEST}/Resources" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
set( locale "${_DEST}/locale" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" )
set( locale "${_DEST}/Languanges" )
@ -142,7 +142,7 @@ foreach( source ${SOURCES} )
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
set( dst "${locale}/${lang}.lproj" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
set( dst "${locale}/${lang}/LC_MESSAGES" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" )
set( dst "${locale}/${lang}" )

View File

@ -479,55 +479,76 @@ list( APPEND SOURCES
# VST Effects
$<$<BOOL:USE_VST>:effects/VST/VSTControl.h>
$<$<BOOL:USE_VST>:effects/VST/VSTEffect.cpp>
$<$<BOOL:USE_VST>:effects/VST/VSTEffect.h>
$<$<BOOL:USE_VST>:effects/VST/aeffectx.h>
$<$<AND:$<BOOL:USE_VST>,$<PLATFORM_ID:Linux>>:effects/VST/VSTControlGTK.cpp>
$<$<AND:$<BOOL:USE_VST>,$<PLATFORM_ID:Linux>>:effects/VST/VSTControlGTK.h>
$<$<AND:$<BOOL:USE_VST>,$<PLATFORM_ID:Windows>>:effects/VST/VSTControlMSW.cpp>
$<$<AND:$<BOOL:USE_VST>,$<PLATFORM_ID:Windows>>:effects/VST/VSTControlMSW.h>
$<$<AND:$<BOOL:USE_VST>,$<PLATFORM_ID:Darwin>>:effects/VST/VSTControlOSX.h>
$<$<AND:$<BOOL:USE_VST>,$<PLATFORM_ID:Darwin>>:effects/VST/VSTControlOSX.mm>
$<$<BOOL:${USE_VST}>:
effects/VST/VSTControl.h
effects/VST/VSTEffect.cpp
effects/VST/VSTEffect.h
effects/VST/aeffectx.h
>
$<$<AND:$<BOOL:${USE_VST}>,$<BOOL:${wxIS_GTK}>>:
effects/VST/VSTControlGTK.cpp
effects/VST/VSTControlGTK.h
>
$<$<AND:$<BOOL:${USE_VST}>,$<BOOL:${wxIS_WIN}>>:
effects/VST/VSTControlMSW.cpp
effects/VST/VSTControlMSW.h
>
$<$<AND:$<BOOL:${USE_VST}>,$<BOOL:${wxIS_MAC}>>:
effects/VST/VSTControlOSX.h
effects/VST/VSTControlOSX.mm
>
# Audio Unit Effects
$<$<AND:$<BOOL:USE_AUDIO_UNITS>,$<PLATFORM_ID:Darwin>>:effects/audiounits/AUControl.h>
$<$<AND:$<BOOL:USE_AUDIO_UNITS>,$<PLATFORM_ID:Darwin>>:effects/audiounits/AUControl.mm>
$<$<AND:$<BOOL:USE_AUDIO_UNITS>,$<PLATFORM_ID:Darwin>>:effects/audiounits/AudioUnitEffect.cpp>
$<$<AND:$<BOOL:USE_AUDIO_UNITS>,$<PLATFORM_ID:Darwin>>:effects/audiounits/AudioUnitEffect.h>
$<$<AND:$<BOOL:${USE_AUDIO_UNITS}>,$<BOOL:${wxIS_MAC}>>:
effects/audiounits/AUControl.h
effects/audiounits/AUControl.mm
effects/audiounits/AudioUnitEffect.cpp
effects/audiounits/AudioUnitEffect.h
>
# Ladspa Effects
$<$<BOOL:USE_LADSPA>:effects/ladspa/LadspaEffect.cpp>
$<$<BOOL:USE_LADSPA>:effects/ladspa/LadspaEffect.h>
$<$<BOOL:USE_LADSPA>:effects/ladspa/ladspa.h>
$<$<BOOL:${USE_LADSPA}>:
effects/ladspa/LadspaEffect.cpp
effects/ladspa/LadspaEffect.h
effects/ladspa/ladspa.h
>
# LV2 Effects
$<$<BOOL:USE_LV2>:effects/lv2/LV2Effect.cpp>
$<$<BOOL:USE_LV2>:effects/lv2/LV2Effect.h>
$<$<BOOL:USE_LV2>:effects/lv2/LoadLV2.cpp>
$<$<BOOL:USE_LV2>:effects/lv2/LoadLV2.h>
$<$<BOOL:USE_LV2>:effects/lv2/NativeWindow.h>
$<$<BOOL:USE_LV2>:effects/lv2/lv2_external_ui.h>
$<$<BOOL:USE_LV2>:effects/lv2/zix/common.h>
$<$<BOOL:USE_LV2>:effects/lv2/zix/ring.cpp>
$<$<BOOL:USE_LV2>:effects/lv2/zix/ring.h>
$<$<BOOL:${USE_LV2}>:
effects/lv2/LV2Effect.cpp
effects/lv2/LV2Effect.h
effects/lv2/LoadLV2.cpp
effects/lv2/LoadLV2.h
effects/lv2/NativeWindow.h
effects/lv2/lv2_external_ui.h
effects/lv2/zix/common.h
effects/lv2/zix/ring.cpp
effects/lv2/zix/ring.h
>
# Nyquist Effects
$<$<BOOL:USE_NYQUIST>:effects/nyquist/LoadNyquist.cpp>
$<$<BOOL:USE_NYQUIST>:effects/nyquist/LoadNyquist.h>
$<$<BOOL:USE_NYQUIST>:effects/nyquist/Nyquist.cpp>
$<$<BOOL:USE_NYQUIST>:effects/nyquist/Nyquist.h>
$<$<BOOL:${USE_NYQUIST}>:
effects/nyquist/LoadNyquist.cpp
effects/nyquist/LoadNyquist.h
effects/nyquist/Nyquist.cpp
effects/nyquist/Nyquist.h
>
# VAMP Effects
$<$<BOOL:USE_VAMP>:effects/vamp/LoadVamp.cpp>
$<$<BOOL:USE_VAMP>:effects/vamp/LoadVamp.h>
$<$<BOOL:USE_VAMP>:effects/vamp/VampEffect.cpp>
$<$<BOOL:USE_VAMP>:effects/vamp/VampEffect.h>
$<$<BOOL:${USE_VAMP}>:
effects/vamp/LoadVamp.cpp
effects/vamp/LoadVamp.h
effects/vamp/VampEffect.cpp
effects/vamp/VampEffect.h
>
# Export
@ -542,14 +563,24 @@ list( APPEND SOURCES
export/ExportMultiple.h
export/ExportPCM.cpp
# Optional exporters
$<$<BOOL:USE_FFMPEG>:export/ExportFFmpeg.cpp>
$<$<BOOL:USE_FFMPEG>:export/ExportFFmpegDialogs.cpp>
$<$<BOOL:USE_FFMPEG>:export/ExportFFmpegDialogs.h>
$<$<BOOL:USE_FLAC>:export/ExportFLAC.cpp>
$<$<BOOL:USE_TWOLAME>:export/ExportMP2.cpp>
$<$<BOOL:USE_LIBVORBIS>:export/ExportOGG.cpp>
$<$<BOOL:${USE_FFMPEG}>:
export/ExportFFmpeg.cpp
export/ExportFFmpegDialogs.cpp
export/ExportFFmpegDialogs.h
>
$<$<BOOL:${USE_LIBFLAC}>:
export/ExportFLAC.cpp
>
$<$<BOOL:${USE_LIBTWOLAME}>:
export/ExportMP2.cpp
>
$<$<BOOL:${USE_LIBVORBIS}>:
export/ExportOGG.cpp
>
# Import
@ -575,14 +606,30 @@ list( APPEND SOURCES
# Optional importers
$<$<BOOL:USE_FFMPEG>:import/ImportFFmpeg.cpp>
$<$<BOOL:USE_FLAC>:import/ImportFLAC.cpp>
$<$<BOOL:USE_GSTREAMER>:import/ImportGStreamer.cpp>
$<$<BOOL:USE_MIDI>:import/ImportMIDI.cpp>
$<$<BOOL:USE_MIDI>:import/ImportMIDI.h>
$<$<BOOL:USE_LIBMAD>:import/ImportMP3.cpp>
$<$<BOOL:USE_LIBVORBIS>:import/ImportOGG.cpp>
# import/ImportQT.cpp
$<$<BOOL:${USE_FFMPEG}>:
import/ImportFFmpeg.cpp
>
$<$<BOOL:${USE_LIBFLAC}>:
import/ImportFLAC.cpp
>
$<$<BOOL:${USE_GSTREAMER}>:
import/ImportGStreamer.cpp
>
$<$<BOOL:${USE_MIDI}>:
import/ImportMIDI.cpp
import/ImportMIDI.h
>
$<$<BOOL:${USE_LIBMAD}>:
import/ImportMP3.cpp
>
$<$<BOOL:${USE_LIBVORBIS}>:
import/ImportOGG.cpp
>
# Menus
@ -914,8 +961,10 @@ list( APPEND INCLUDES
#
#
list( APPEND RESOURCES
$<$<PLATFORM_ID:Windows>:../win/audacity.rc>
$<$<PLATFORM_ID:Windows>:../win/packages.config>
$<$<PLATFORM_ID:Windows>:
../win/audacity.rc
../win/packages.config
>
)
#
@ -953,7 +1002,7 @@ list( APPEND DEFINES
list( APPEND OPTIONS
PRIVATE
$<$<PLATFORM_ID:Windows>:/permissive->
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
# $<$<CXX_COMPILER_ID:GNU>:-Wl,-rpath -Wl,${_RPATH}>
)
@ -968,7 +1017,7 @@ list( APPEND LDFLAGS
list( APPEND LIBRARIES
PRIVATE
${CMAKE_REQUIRED_LIBRARIES}
wxwidgets
wxWidgets
FileDialog
expat
lame
@ -976,36 +1025,44 @@ list( APPEND LIBRARIES
libsoxr
lib-widget-extra
portaudio-v19
$<$<BOOL:USE_FFMPEG>:libavcodec>
$<$<BOOL:USE_FFMPEG>:libavformat>
$<$<BOOL:USE_FFMPEG>:libavutil>
$<$<BOOL:USE_LIBID3TAG>:libid3tag>
$<$<BOOL:USE_LIBFLAC>:libflac>
$<$<BOOL:USE_LIBFLAC>:libflac++>
$<$<BOOL:USE_LIBMAD>:libmad>
$<$<BOOL:USE_LIBVORBIS>:libogg>
$<$<BOOL:USE_LIBVORBIS>:libvorbis>
$<$<BOOL:USE_LIBVORBIS>:libvorbisenc>
$<$<BOOL:USE_LIBVORBIS>:libvorbisfile>
$<$<BOOL:USE_LIBTWOLAME>:twolame>
$<$<BOOL:USE_LV2>:lv2>
$<$<BOOL:USE_MIDI>:portmidi>
$<$<BOOL:USE_MIDI>:portsmf>
$<$<BOOL:USE_NYQUIST>:libnyquist>
$<$<BOOL:USE_PORTMIXER>:portmixer>
$<$<BOOL:USE_SBSMS>:sbsms>
$<$<BOOL:USE_SOUNDTOUCH>:soundtouch>
$<$<BOOL:USE_VAMP>:libvamp>
$<$<BOOL:USE_VAMP>:libvamp-hostsdk>
# $<$<BOOL:${USE_FFMPEG}>:ibavcodec>
# $<$<BOOL:${USE_FFMPEG}>:libavformat>
# $<$<BOOL:${USE_FFMPEG}>:libavutil>
$<$<BOOL:${USE_FFMPEG}>:ffmpeg>
$<$<BOOL:${USE_LIBID3TAG}>:libid3tag>
# This flac mess can be resolved by removing the Windows pragmas
# in AudacityApp.cpp.
$<$<BOOL:${USE_LIBFLAC}>:flac>
$<$<BOOL:${USE_LIBFLAC}>:flac++>
$<$<BOOL:${USE_LIBFLAC}>:libflac>
$<$<BOOL:${USE_LIBMAD}>:libmad>
$<$<BOOL:${USE_LIBVORBIS}>:libogg>
$<$<BOOL:${USE_LIBVORBIS}>:libvorbis>
# $<$<BOOL:${USE_LIBVORBIS}>:libvorbis>
# $<$<BOOL:${USE_LIBVORBIS}>:libvorbisenc>
# $<$<BOOL:${USE_LIBVORBIS}>:libvorbisfile>
$<$<BOOL:${USE_LIBTWOLAME}>:twolame>
$<$<BOOL:${USE_LV2}>:lv2>
$<$<BOOL:${USE_MIDI}>:portmidi>
$<$<BOOL:${USE_MIDI}>:portsmf>
$<$<BOOL:${USE_NYQUIST}>:libnyquist>
$<$<BOOL:${USE_PORTMIXER}>:portmixer>
$<$<BOOL:${USE_SBSMS}>:sbsms>
$<$<BOOL:${USE_SOUNDTOUCH}>:soundtouch>
$<$<BOOL:${USE_VAMP}>:libvamp>
# $<$<BOOL:${USE_VAMP}>:libvamp-hostsdk>
$<$<PLATFORM_ID:Linux,FreeBSD>:PkgConfig::GLIB>
$<$<PLATFORM_ID:Linux,FreeBSD>:z>
$<$<PLATFORM_ID:Linux,FreeBSD>:pthread>
)
#
# If was have cmake 3.16 or higher, we can use precompiled headers
#
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" )
list( APPEND PRECOMP
AudacityHeaders.h
)
set( PRECOMP AudacityHeaders.h )
endif()
# Handle Ladspa option
@ -1062,12 +1119,11 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
set( wxlibs "${CMAKE_BINARY_DIR}" )
endif()
file( TO_NATIVE_PATH ${_DEST} dest )
add_custom_command(
TARGET
${TARGET}
COMMAND
XCOPY "*.dll" ${dest} /I /R /Y
XCOPY "*.dll" $<SHELL_PATH:${_DEST}> /I /R /Y
WORKING_DIRECTORY
"${wxlibs}/lib/vc_dll"
POST_BUILD
@ -1106,6 +1162,7 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
list(APPEND LIBRARIES
PRIVATE
"-framework AudioUnit"
"-framework CoreAudio"
"-framework CoreAudioKit"
)
@ -1139,9 +1196,7 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
TARGET
${TARGET}
COMMAND
sh -c "TARGET_BUILD_DIR=${_DEST} EXECUTABLE_PATH=${_EXEDIR}/${_EXE} FRAMEWORKS_FOLDER_PATH=Frameworks ${topdir}/mac/scripts/install_wxlibs.sh"
# WORKING_DIRECTORY
# ${CMAKE_BINARY_DIR}/lib
sh -c "TARGET_BUILD_DIR=${_DEST} EXECUTABLE_PATH=Macos/${_EXE} FRAMEWORKS_FOLDER_PATH=Frameworks ${topdir}/mac/scripts/install_wxlibs.sh"
POST_BUILD
)
endif()
@ -1163,63 +1218,66 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" )
target_sources( "Wrapper" PRIVATE ${WRAPPER_SOURCES} )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD" )
set( _EXE "audacity" )
# Add additional library requirements
list( APPEND LIBRARIES
PRIVATE
PkgConfig::GLIB
z
pthread
)
# Create the config file
set( HAVE_VISIBILITY 1 )
configure_file( audacity_config.h.in private/configunix.h )
# Create the MIMETYPES list (must be a better way...)
if( USE_FFMPEG)
list( APPEND MIMETYPES "audio/aac;audio/ac3;audio/mp4;audio/x-ms-wma;video/mpeg" )
endif()
if( USE_LIBFLAC)
list( APPEND MIMETYPES "audio/flac;audio/x-flac" )
endif()
if( USE_LIBMAD )
list( APPEND MIMETYPES "audio/mpeg" )
endif()
if( USE_SNDFILE )
list( APPEND MIMETYPES "audio/basic;audio/x-aiff;audio/x-wav" )
endif()
if( USE_LIBOGG AND USE_LIBVORBIS )
list( APPEND MIMETYPES "application/ogg;audio/x-vorbis+ogg" )
endif()
# Create the MIMETYPES list
list( APPEND MIMETYPES
$<$<BOOL:${USE_FFMPEG}>:
audio/aac
audio/ac3
audio/mp4
audio/x-ms-wma
video/mpeg
>
$<$<BOOL:${USE_LIBFLAC}>:
audio/flac
audio/x-flac
>
$<$<BOOL:${USE_LIBMAD}>:
audio/mpeg
>
$<$<BOOL:${USE_SNDFILE}>:
audio/basic
audio/x-aiff
audio/x-wav
>
$<$<AND:$<BOOL:${USE_LIBOGG},${USE_LIBVORBIS}>>:
application/ogg
audio/x-vorbis+ogg
>
)
# Create the desktop file
set( AUDACITY_NAME "${_EXE}" )
configure_file( audacity.desktop.in ${_INTDIR}/audacity.desktop )
# Create the script to copy required wxWidgets libraries
file( WRITE "${_INTDIR}/copy_libs.sh"
"for lib in \$(ldd ${_EXEDIR}/${_EXE} | awk '/libwx/{print \$1}')
do
echo \${lib}
ldd ${WXWIN}/lib/\${lib} | awk '/libwx/{print \$1}'
done | sort -u | xargs cp -n -H -t ${_LIBDIR}
rm \${0}"
)
# And run it after the build
add_custom_command(
TARGET
${TARGET}
COMMAND
sh "${_INTDIR}/copy_libs.sh"
WORKING_DIRECTORY
${WXWIN}/lib
POST_BUILD
)
if( NOT use_system_wxwidgets )
file( WRITE "${_INTDIR}/copy_libs.sh"
"for lib in \$(ldd ${_EXEDIR}/${_EXE} | awk '/libwx/{print \$1}')
do
echo \${lib}
ldd ${WXWIN}/lib/\${lib} | awk '/libwx/{print \$1}'
done | sort -u | xargs cp -n -H -t ${_LIBDIR}
rm \${0}"
)
# And run it after the build
add_custom_command(
TARGET
${TARGET}
COMMAND
sh "${_INTDIR}/copy_libs.sh"
WORKING_DIRECTORY
${WXWIN}/lib
POST_BUILD
)
endif()
endif()
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_NAME ${_EXE} )
@ -1253,7 +1311,10 @@ target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_options( "${TARGET}" PRIVATE ${LDFLAGS} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )
target_precompile_headers( ${TARGET} PRIVATE ${PRECOMP} )
if( PRECOMP )
target_precompile_headers( ${TARGET} PRIVATE ${PRECOMP} )
endif()
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )

View File

@ -28,6 +28,9 @@
/* Define if you have C99's lrintf function. */
#cmakedefine HAVE_LRINTF 1
/* Define if you have the mlock functions. */
#cmakedefine HAVE_MLOCK 1
/* Define to 1 or 0, depending whether the compiler supports simple visibility
declarations. */
#cmakedefine HAVE_VISIBILITY 1