Browse Source

More cmake updates

Uses system libraries by default with a fallback to local
Adds the Wrapper build on OSX
Adds mod_script_pipe
Adds ffmpeg
Some additional cleanup
au-ny-api
Leland Lucius 3 years ago
parent
commit
2e113ba0a5
  1. 46
      CMakeLists.txt
  2. 185
      cmake-proxies/CMakeLists.txt
  3. 6
      cmake-proxies/FileDialog/CMakeLists.txt
  4. 2
      cmake-proxies/cmake-modules/MacOSXBundleInfo.plist.in
  5. 2
      cmake-proxies/expat/CMakeLists.txt
  6. 65
      cmake-proxies/ffmpeg/CMakeLists.txt
  7. 2
      cmake-proxies/lame/CMakeLists.txt
  8. 3
      cmake-proxies/lib-widget-extra/CMakeLists.txt
  9. 1
      cmake-proxies/libid3tag/CMakeLists.txt
  10. 1
      cmake-proxies/libmad/CMakeLists.txt
  11. 1
      cmake-proxies/libnyquist/CMakeLists.txt
  12. 3
      cmake-proxies/libogg/CMakeLists.txt
  13. 3
      cmake-proxies/libscorealign/CMakeLists.txt
  14. 2
      cmake-proxies/libsndfile/CMakeLists.txt
  15. 2
      cmake-proxies/libsoxr/CMakeLists.txt
  16. 4
      cmake-proxies/libvamp/CMakeLists.txt
  17. 4
      cmake-proxies/libvorbis/CMakeLists.txt
  18. 14
      cmake-proxies/lv2/CMakeLists.txt
  19. 56
      cmake-proxies/mod-script-pipe/CMakeLists.txt
  20. 2
      cmake-proxies/portaudio-v19/CMakeLists.txt
  21. 2
      cmake-proxies/portmidi/CMakeLists.txt
  22. 2
      cmake-proxies/portmixer/CMakeLists.txt
  23. 4
      cmake-proxies/portsmf/CMakeLists.txt
  24. 3
      cmake-proxies/sbsms/CMakeLists.txt
  25. 3
      cmake-proxies/soundtouch/CMakeLists.txt
  26. 2
      cmake-proxies/twolame/CMakeLists.txt
  27. 18
      cmake-proxies/wxwidgets/CMakeLists.txt
  28. 66
      src/CMakeLists.txt

46
CMakeLists.txt

@ -48,8 +48,7 @@ elseif( APPLE )
set( CMAKE_OSX_SYSROOT macosx CACHE INTERNAL "" )
# A bit of a no-no, but couldn't figure out a better way to make it GLOBAL
set( CMAKE_CXX_FLAGS "-stdlib=libc++ -std=gnu++11" )
set( CMAKE_CXX_FLAGS "-stdlib=libc++" )
endif()
# Add our module path
@ -60,6 +59,10 @@ set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules)
#set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF )
#set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_Debug OFF )
# Set the required C++ stardard
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
# Our very own project
project( Audacity )
@ -70,6 +73,7 @@ include( CheckIncludeFiles )
include( CheckLibraryExists )
include( CheckSymbolExists )
include( CheckTypeSize )
include( CMakeDependentOption )
include( CMakeDetermineASM_NASMCompiler )
include( CMakePushCheckState )
include( GNUInstallDirs )
@ -193,7 +197,10 @@ check_type_size( "size_t" SIZEOF_SIZE LANGUAGE C )
check_type_size( "wchar_t" SIZEOF_WCHAR LANGUAGE C )
check_type_size( "void*" SIZEOF_POINTER LANGUAGE C )
# We'll be using it if it's available
find_package( PkgConfig )
# Mostly just to make the CMP0072 policy happy
find_package( OpenGL )
# When called will define several useful directory paths for the
@ -214,7 +221,7 @@ endif()
set( _MODDIR "${_EXEDIR}/modules" )
set( _RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/audacity" )
# Helper to organize sources into folder for the IDEs
# Helper to organize sources into folders for the IDEs
macro( organize_source root prefix sources )
set( cleaned )
foreach(source ${sources})
@ -228,7 +235,7 @@ macro( organize_source root prefix sources )
list( APPEND cleaned "${source}" )
endforeach()
# Define source groups
# Define the source groups
if( "${prefix}" STREQUAL "" )
source_group( TREE "${root}" FILES ${cleaned} )
else()
@ -253,6 +260,36 @@ function( set_dir_folder dir folder)
endforeach()
endfunction()
# Helper to retrieve the settings returned from pkg_check_modules()
macro( get_package_interface package )
set( INCLUDES
INTERFACE
${${package}_INCLUDE_DIRS}
)
set( CLFAGS
INTERFACE
${${package}_CFLAGS}
${${package}_CFLAGS_OTHER}
)
set( LDFLAGS
INTERFACE
${${package}_LDFLAGS}
${${package}_LDFLAGS_OTHER}
)
set( LINKDIRS
INTERFACE
${${package}_LIBRARY_DIRS}
)
set( LIBRARIES
INTERFACE
${${package}_LIBRARIES}
)
endmacro()
# Add our children
add_subdirectory( "cmake-proxies" )
add_subdirectory( "help" )
@ -260,6 +297,7 @@ add_subdirectory( "locale" )
add_subdirectory( "nyquist" )
add_subdirectory( "plug-ins" )
add_subdirectory( "src" )
add_subdirectory( "cmake-proxies/mod-script-pipe" )
# Uncomment what follows for symbol values.
#[[

185
cmake-proxies/CMakeLists.txt

@ -1,68 +1,134 @@
#These are done in their actual directories, no need for a proxy.
# Allow user to globally set the system library preference
option( prefer_system_libs "Use system libraries if available" YES )
#Same idea, but not yet done/needed
#add_subdirectory( "mod-null" )
#add_subdirectory( "mod-nyq-bench" )
#add_subdirectory( "mod-track-panel" )
#These are all headers, nothing to build.
#add_subdirectory( "ffmpeg" )
function( addlib dir name symbol required version )
message( STATUS "========== Configuring ${name} ==========" )
#
# Add individual library targets
#
# Parms:
# dir directory name within the cmake-proxies directory.
# (Doesn't HAVE to match the same directory in lib-src,
# but it usually does.)
#
# name suffix for the cmake user options
#
# symbol suffix for the "USE_<symbol>" variable that the Audacity
# target uses to include/exclude functionality.
#
# requried Determines if the library is required or not. If it is,
# the user is not given the option of enabling/disabling it.
#
# check Determines if local/system checks should be performed here
# or in the subdirectory config.
#
# packages A list of packages required for this target in pkg-config
# format.
function( addlib dir name symbol required check ) #packages )
# Extract the list of packages from the function args
list( SUBLIST ARGV 5 -1 packages )
# Define target's name and it's source directory
set( TARGET ${dir} )
set( TARGET_ROOT ${libsrc}/${dir} )
# If the target is required, then it's always enabled. Otherwise,
# give the user the option to enable/disable it.
set( enable enable_${name} )
if( NOT ${required} )
option( ${enable} "Enable ${name} library" ON )
if( required )
set( ${enable} YES )
else()
set( ${enable} ON )
option( ${enable} "Enable ${name} library" ON )
endif()
set( use_system use_system_${name} )
if( PkgConfig_FOUND AND version )
option( ${use_system} "Prefer ${name} system library if available" OFF )
else()
set( ${use_system} OFF )
# Bail if the target isn't enabled.
if( NOT ${enable} )
message( STATUS "========== ${name} disabled ==========" )
return()
endif()
if( NOT ${${enable}} )
# If we're not checking for system or local here, then let the
# target config handle the rest.
if( NOT check )
add_subdirectory( ${dir} EXCLUDE_FROM_ALL )
return()
endif()
# Only present the system library option if pkg-config was found and
# a package has been specified. Otherwise, the local library will
# be used unconditionally.
set( system use_system_${name} )
if( PkgConfig_FOUND AND packages )
option( ${system} "Use ${name} system library if available" ${prefer_system_libs} )
else()
set( ${system} NO )
endif()
message( STATUS "========== Configuring ${name} ==========" )
# Let the Audacity target know that this library will be used.
set( USE_${symbol} ON CACHE INTERNAL USE_${symbol} )
if( ${${use_system}} )
pkg_check_modules( ${name} ${version} )
if( ${${name}_FOUND} )
message( STATUS "Using SYSTEM '${name}' package" )
# Check for the system package if the user prefers it.
if( ${system} )
# Look them up
pkg_check_modules( ${symbol} ${packages} )
if( ${symbol}_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 )
target_compile_options( ${TARGET} INTERFACE ${${name}_CFLAGS_OTHER} )
target_include_directories( ${TARGET} INTERFACE ${${name}_INCLUDE_DIRS} )
target_link_libraries( ${TARGET} INTERFACE ${${name}_LIBRARIES} )
# Retrieve the package information
get_package_interface( ${symbol} )
# And add it to our target
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
target_compile_options( ${TARGET} INTERFACE ${CFLAGS} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_options( ${TARGET} INTERFACE ${LDFLAGS} )
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 LOCAL '${name}' package" )
set( TARGET_ROOT ${libsrc}/${dir} )
message( STATUS "Using '${name}' local library" )
# 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 )
# Set the folder (for the IDEs) for each one
foreach( target ${targets} )
# Add "global" defines
set( DEFINES
NDEBUG
)
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
# 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" )
# Add "global" defines
set( DEFINES
NDEBUG
)
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
set_target_properties( ${target} PROPERTIES FOLDER "lib-src" )
endif()
endforeach()
@ -70,31 +136,32 @@ endfunction()
# Required libraries
#
# directory option symbol req version
addlib( wxwidgets wxWidgets WXWIDGETS YES "" )
addlib( FileDialog FileDialog FILEDIALOG YES "" )
addlib( expat expat EXPAT YES "" )
addlib( lame lame LAME YES "lame >= 3.100" )
addlib( lib-widget-extra libextra WIDGET YES "" )
addlib( libsndfile sndfile SNDFILE YES "sndfile >= 1.0.24" )
addlib( libsoxr soxr SOXR YES "soxr >= 0.1.1" )
addlib( portaudio-v19 portaudio PORTAUDIO YES "" )
# directory option symbol req chk version
addlib( wxwidgets wxwidgets WXWIDGETS 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( 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 "" )
# Optional libraries
#
# directory option symbol req version
addlib( lv2 lv2 LV2 NO "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( libid3tag id3tag LIBID3TAG NO "id3tag >= 0.15.1b" )
addlib( libmad mad LIBMAD NO "mad >= 2.3" )
addlib( libnyquist nyquist NYQUIST NO "" )
addlib( libvamp vamp VAMP NO "vamp >= 2.5" )
addlib( libogg ogg LIBOGG NO "ogg >= 1.3.1" )
addlib( libvorbis vorbis LIBVORBIS NO "vorbis >= 1.3.3" )
addlib( libflac flac LIBFLAC NO "flac >= 1.3.1" )
addlib( portmidi midi PORTMIDI NO "portmidi >= 0.1" )
addlib( portmixer portmixer PORTMIXER NO "" )
addlib( portsmf portsmf PORTSMF NO "portsmf >= 0.1" )
addlib( sbsms sbsms SBSMS NO "sbsms >= 2.0.2" )
addlib( soundtouch soundtouch SOUNDTOUCH NO "soundtouch >= 1.7.1" )
addlib( twolame twolame LIBTWOLAME NO "twolame >= 0.3.13" )
# directory option symbol req chk version
addlib( ffmpeg ffmpeg FFMPEG NO NO "libavcodec >= 51.53" "libavformat >= 52.12" "libavutil >= 52.66" )
addlib( libid3tag id3tag LIBID3TAG NO YES "id3tag >= 0.15.1b" )
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( 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( portmixer portmixer PORTMIXER NO YES "" )
addlib( portsmf portsmf PORTSMF NO YES "portsmf >= 0.1" )
addlib( sbsms sbsms SBSMS NO YES "sbsms >= 2.0.2" )
addlib( soundtouch soundtouch SOUNDTOUCH NO YES "soundtouch >= 1.7.1" )
addlib( twolame twolame LIBTWOLAME NO YES "twolame >= 0.3.13" )

6
cmake-proxies/FileDialog/CMakeLists.txt

@ -26,11 +26,6 @@ list( APPEND OPTIONS
$<$<PLATFORM_ID:Linux>:-Wno-deprecated-declarations>
)
list( APPEND FEATURES
PRIVATE
cxx_std_11
)
list( APPEND LIBRARIES
PRIVATE
wxwidgets
@ -42,7 +37,6 @@ organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_compile_features( ${TARGET} PRIVATE ${FEATURES} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )

2
cmake-proxies/cmake-modules/MacOSXBundleInfo.plist.in

@ -203,7 +203,7 @@
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Audacity</string>
<string>Wrapper</string>
<key>CFBundleGetInfoString</key>
<string>Audacity version ${AUDACITY_INFO_VERSION}</string>
<key>CFBundleIconFile</key>

2
cmake-proxies/expat/CMakeLists.txt

@ -40,8 +40,6 @@ configure_file( ${TARGET_ROOT}/expat_config.h.cmake private/expat_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} )

65
cmake-proxies/ffmpeg/CMakeLists.txt

@ -1,19 +1,54 @@
#directory cmake-proxies/expat
set( TARGET expat )
set( TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET} )
project( ${TARGET} )
set( SOURCES
${TARGET_SOURCE}/lib/xmlparse.c
#${LIB_SRC_DIRECTORY}FileDialog/gtk/FileDialogPrivate.cpp #not on windows.
#${LIB_SRC_DIRECTORY}${TARGET}/win/FileDialogPrivate.cpp
)
# This defines the #define on both Windows and Linux.
add_definitions( )
add_library( ${TARGET} MODULE ${SOURCES})
# Add our target and all of it's aliases
add_library( ${TARGET} INTERFACE )
add_library( libavcodec ALIAS ${TARGET} )
add_library( libavformat ALIAS ${TARGET} )
add_library( libavutil ALIAS ${TARGET} )
target_include_directories( ${TARGET} PRIVATE
# Pull in standard variables
def_vars()
)
message( STATUS "========== Configuring ${TARGET} ==========" )
# Let the Audacity target know we're using ffmpeg
set( USE_FFMPEG ON CACHE INTERNAL USE_FFMPEG )
# Add the system/local option
option( use_system_${TARGET} "Use ${TARGET} system library if available" ${prefer_system_libs} )
# Look up the system packages if the user wants them
if( use_system_${TARGET} )
# 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)
# 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 "" )
endif()
# If the system packages were found
if( ${TARGET}_FOUND )
message( STATUS "Using '${TARGET}' system library" )
# Pull in the package settings
get_package_interface( ${TARGET} )
else()
message( STATUS "Using '${TARGET}' local library" )
# Otherwise define the local settings
list( APPEND INCLUDES
INTERFACE
${TARGET_ROOT}
)
endif()
# And add the settings to the target
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
target_compile_options( ${TARGET} INTERFACE ${CFLAGS} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_options( ${TARGET} INTERFACE ${LDFLAGS} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
target_link_libraries( ${TARGET} )

2
cmake-proxies/lame/CMakeLists.txt

@ -89,8 +89,6 @@ configure_file( lame.h.in public/lame/lame.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} )

3
cmake-proxies/lib-widget-extra/CMakeLists.txt

@ -18,9 +18,6 @@ list( APPEND 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} )

1
cmake-proxies/libid3tag/CMakeLists.txt

@ -44,7 +44,6 @@ 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_features( ${TARGET} PRIVATE ${FEATURES} )
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )

1
cmake-proxies/libmad/CMakeLists.txt

@ -46,7 +46,6 @@ configure_file( mad.h.in public/mad.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} )

1
cmake-proxies/libnyquist/CMakeLists.txt

@ -300,7 +300,6 @@ list( APPEND 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} )

3
cmake-proxies/libogg/CMakeLists.txt

@ -82,8 +82,5 @@ configure_file( config_types.h.in public/ogg/config_types.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} )

3
cmake-proxies/libscorealign/CMakeLists.txt

@ -21,9 +21,6 @@ list( APPEND INCLUDES
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} )

2
cmake-proxies/libsndfile/CMakeLists.txt

@ -176,8 +176,6 @@ configure_file( config.h.in ${_PRVDIR}/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} )

2
cmake-proxies/libsoxr/CMakeLists.txt

@ -88,8 +88,6 @@ configure_file( soxr-config.h.in private/soxr-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} )

4
cmake-proxies/libvamp/CMakeLists.txt

@ -1,5 +1,6 @@
add_library( ${TARGET} STATIC )
add_library( ${TARGET}-hostsdk ALIAS ${TARGET} )
list( APPEND SOURCES
PRIVATE
@ -26,8 +27,5 @@ list( APPEND DEFINES
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} )

4
cmake-proxies/libvorbis/CMakeLists.txt

@ -1,5 +1,7 @@
add_library( ${TARGET} STATIC )
add_library( ${TARGET}enc ALIAS ${TARGET} )
add_library( ${TARGET}file ALIAS ${TARGET} )
list( APPEND SOURCES
PRIVATE
@ -51,8 +53,6 @@ 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} )

14
cmake-proxies/lv2/CMakeLists.txt

@ -174,14 +174,19 @@ macro( bld name packages define sources )
if( NOT missing )
list( APPEND DEFINES
# PUBLIC
PRIVATE
${define}
)
add_library( ${name} SHARED "${sources}" )
set_target_properties( ${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_MODDIR} )
add_library( ${name} MODULE "${sources}" )
add_dependencies( ${TARGET} ${name} )
set_target_properties( ${name}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${_LIBDIR}"
PREFIX ""
)
organize_source( "${TARGET_ROOT}" "" "${sources}" )
target_compile_definitions( ${name} PRIVATE SUIL_SHARED ${DEFINES} )
target_include_directories( ${name} PRIVATE ${INCLUDES} )
@ -266,8 +271,5 @@ configure_file( suil_config.h.in "${_PRVDIR}/suil_config.h" )
organize_source( "${TARGET_ROOT}" "" "${SOURCES} ${HEADERS}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} ${HEADERS} )# ${stamp} )
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} )

56
cmake-proxies/mod-script-pipe/CMakeLists.txt

@ -1,20 +1,46 @@
#directory cmake-proxies/mod-script-pipe
set( TARGET mod-script-pipe )
set( TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET} )
project( ${TARGET} )
find_package(wxWidgets REQUIRED COMPONENTS net core base)
include(${wxWidgets_USE_FILE})
set( SOURCES
${TARGET_SOURCE}/PipeServer.cpp
${TARGET_SOURCE}/ScripterCallback.cpp
set( TARGET_ROOT "${libsrc}/${TARGET}" )
message( STATUS "========== Configuring ${TARGET} ==========" )
def_vars()
add_library( ${TARGET} MODULE )
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/PipeServer.cpp
${TARGET_ROOT}/ScripterCallback.cpp
)
list( APPEND INCLUDES
PUBLIC
${TARGET_ROOT}
)
list( APPEND DEFINES
PRIVATE
BUILDING_SCRIPT_PIPE
)
# This defines the #define on both Windows and Linux.
add_definitions( -DBUILDING_SCRIPT_PIPE )
add_library( ${TARGET} MODULE ${SOURCES})
target_include_directories( ${TARGET} PRIVATE
${top_dir}/win
list( APPEND LIBRARIES
PRIVATE
wxwidgets
Audacity
)
target_link_libraries( ${TARGET} ${wxWidgets_LIBRARIES})
set_target_properties( ${TARGET}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${_MODDIR}"
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${_MODDIR}"
LIBRARY_OUTPUT_DIRECTORY "${_MODDIR}"
PREFIX ""
)
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} )

2
cmake-proxies/portaudio-v19/CMakeLists.txt

@ -142,8 +142,6 @@ endif()
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} )

2
cmake-proxies/portmidi/CMakeLists.txt

@ -46,8 +46,6 @@ list( APPEND OPTIONS
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} )

2
cmake-proxies/portmixer/CMakeLists.txt

@ -41,8 +41,6 @@ list( APPEND 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} )

4
cmake-proxies/portsmf/CMakeLists.txt

@ -20,9 +20,5 @@ list( APPEND INCLUDES
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} )

3
cmake-proxies/sbsms/CMakeLists.txt

@ -47,9 +47,6 @@ 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} )

3
cmake-proxies/soundtouch/CMakeLists.txt

@ -43,9 +43,6 @@ configure_file( soundtouch_config.h.in public/soundtouch_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} )

2
cmake-proxies/twolame/CMakeLists.txt

@ -49,8 +49,6 @@ 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} )

18
cmake-proxies/wxwidgets/CMakeLists.txt

@ -3,22 +3,24 @@ add_library( ${TARGET} INTERFACE )
def_vars()
option( use_system_wxwidgets "Prefer wxWidgets system library if available" ON )
message( STATUS "========== Configuring ${TARGET} ==========" )
option( use_system_wxwidgets "Use ${TARGET} system library if available" ${prefer_system_libs} )
if( use_system_wxwidgets )
find_package(wxWidgets)
endif()
if( wxWidgets_FOUND )
#include(${wxWidgets_USE_FILE})
message( STATUS "Using '${TARGET}' system library" )
if( wxWidgets_INCLUDE_DIRS_NO_SYSTEM )
set( INCLUDES
INTERFACE
${wxWidgets_INCLUDE_DIRS}
${wxWidgets_INCLUDE_DIRS_NO_SYSTEM}
)
else()
set( INCLUDES
SYSTEM
INTERFACE
${wxWidgets_INCLUDE_DIRS}
)
endif()
@ -29,6 +31,11 @@ if( wxWidgets_FOUND )
${wxWidgets_DEFINITIONS_DEBUG}
)
set( LINKDIRS
INTERFACE
$<$<PLATFORM_ID:Windows>:${wxWidgets_LIB_DIR}>
)
set( LIBRARIES
INTERFACE
${wxWidgets_LIBRARIES}
@ -37,6 +44,8 @@ if( wxWidgets_FOUND )
set( toolkit "${wxWidgets_LIBRARIES}" )
else()
message( STATUS "Using '${TARGET}' system library" )
set( use_system_wxwidgets OFF CACHE BOOL "Prefer wxWidgets system library if available" FORCE )
set( WXWIN $ENV{WXWIN} )
@ -146,5 +155,6 @@ endif()
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
target_compile_definitions( ${TARGET} INTERFACE ${DEFINES} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )

66
src/CMakeLists.txt

@ -903,7 +903,7 @@ list( APPEND HEADERS
#
#
list( APPEND INCLUDES
PRIVATE
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/private
${topdir}/lib-src/lib-widget-extra
${topdir}/include
@ -953,17 +953,10 @@ list( APPEND DEFINES
list( APPEND OPTIONS
PRIVATE
-std=c++11
$<$<CXX_COMPILER_ID:Clang>:-stdlib=libc++>
$<$<PLATFORM_ID:Windows>:/permissive->
# $<$<CXX_COMPILER_ID:GNU>:-Wl,-rpath -Wl,${_RPATH}>
)
list( APPEND FEATURES
PRIVATE
cxx_std_11
)
list( APPEND LDFLAGS
PRIVATE
$<$<PLATFORM_ID:Windows>:/MANIFEST:NO>
@ -983,12 +976,17 @@ 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>
@ -998,6 +996,7 @@ list( APPEND LIBRARIES
$<$<BOOL:USE_SBSMS>:sbsms>
$<$<BOOL:USE_SOUNDTOUCH>:soundtouch>
$<$<BOOL:USE_VAMP>:libvamp>
$<$<BOOL:USE_VAMP>:libvamp-hostsdk>
)
#
@ -1020,10 +1019,12 @@ set( USE_VST ${enable_vst} )
set( AUDACITY_NAME "Audacity" )
set( BUILDING_AUDACITY 1 )
set( INSTALL_PREFIX "" )
#set( DISABLE_DYNAMIC_LOADING_FFMPEG 1 )
#set( DISABLE_DYNAMIC_LOADING_LAME 1 )
set( LIBDIR "" )
set( HAVE_GTK ${GTK_FOUND} )
set( DISABLE_DYNAMIC_LOADING_FFMPEG ${disable_dynamic_loading} )
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
set_directory_properties(
PROPERTIES
# Make sure Audacity is the startup project
@ -1069,7 +1070,9 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
"${wxlibs}/lib/vc_dll"
POST_BUILD
)
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
# Handle Audio Units option
option( enable_audiounits "Enable Audio Unit plug-in support" ON )
set( USE_AUDIO_UNITS ${enable_audiounits} )
@ -1137,7 +1140,33 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
${CMAKE_BINARY_DIR}/lib
POST_BUILD
)
# Define the Wrapper target
add_executable( Wrapper )
add_dependencies( Wrapper "${TARGET}" )
set( WRAPPER_ROOT
${TARGET_ROOT}/../mac
)
set( WRAPPER_SOURCES
${WRAPPER_ROOT}/Wrapper.c
)
set_target_properties(
"Wrapper"
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${_EXEDIR}/MacOS"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${_EXEDIR}/MacOS"
RUNTIME_OUTPUT_DIRECTORY "${_EXEDIR}/MacOS"
)
organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" )
target_sources( "Wrapper" PRIVATE ${WRAPPER_SOURCES} )
elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
# Add additional library requirements
list( APPEND LIBRARIES
PRIVATE
@ -1170,6 +1199,7 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Linux" )
${WXWIN}/lib
POST_BUILD
)
endif()
find_package (Git)
@ -1177,25 +1207,37 @@ if (GIT_FOUND)
execute_process(
COMMAND
${GIT_EXECUTABLE} show -s "--format=\"%H\";\"%cd\";"
WORKING_DIRECTORY
${TARGET_ROOT}
OUTPUT_VARIABLE
output
)
list( GET output 0 long )
list( GET output 1 time )
list( APPEND DEFINES
REV_LONG=${long}
REV_TIME=${time}
)
endif()
install(
TARGETS
${TARGET}
CONFIGURATIONS
"" Debug Release RelWithDebInfo RelWithDebInfo
RUNTIME DESTINATION
${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION
${CMAKE_INSTALL_BINDIR}
)
organize_source( "${TARGET_ROOT}/.." "include" "${HEADERS}" )
organize_source( "${TARGET_ROOT}/../win" "win" "${RESOURCES}" )
organize_source( "${TARGET_ROOT}" "src" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} )
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_options( "${TARGET}" PRIVATE ${LDFLAGS} )

Loading…
Cancel
Save