1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-28 06:29:24 +02:00
audacity/cmake-proxies/ffmpeg/CMakeLists.txt
Leland Lucius e79274a403 Various cmake changes
Mostly from suggestions, but there's a couple of other minor
fixes and additions:

   Cmake not decides with SDK to use on Windows

   All Audacity cmake options are not prefixed with "audacity_", but this
   is configurable in audacity/CMakeLists.txt

   Several other options have been marked advanced so they don't clutter
   the CMake GUI

   On Windows, multiple processors will now be used reducing build time
   considerably

   Quieted a couple of package messages that the user doesn't need to see

   No longer tried to create aliases on Windows

   No longer used precompiled headers if ccache is available

   On Windows, only copies the needed wxWidgets and VC runtime libraries
   to the bin directory
2020-02-12 01:05:51 -06:00

56 lines
1.8 KiB
CMake

# 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} )
# Pull in standard variables
def_vars()
message( STATUS "========== Configuring ${name} ==========" )
# Let the Audacity target know we're using ffmpeg
set( USE_${symbol} ON CACHE INTERNAL USE_${symbol} )
# Add the system/local option
option( ${_OPT}use_system_${name} "Use ${name} system library if available" ${${_OPT}prefer_system_libs} )
# Look up the system packages if the user wants them
if( ${_OPT}use_system_${name} )
# Provide an option that determines if the libraries are loaded
# dynamically at run time or statically linked at build time
option( ${_OPT}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( ${_OPT}disable_dynamic_${name} NO CACHE INTERNAL "" )
endif()
# If the system packages were found
if( ${TARGET}_FOUND )
message( STATUS "Using '${name}' system library" )
# Pull in the package settings
get_package_interface( ${TARGET} )
else()
message( STATUS "Using '${name}' 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 ${COPTS} )
target_link_directories( ${TARGET} INTERFACE ${LINKDIRS} )
target_link_options( ${TARGET} INTERFACE ${LOPTS} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )