mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-15 15:11:12 +02:00
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
This commit is contained in:
@@ -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} )
|
Reference in New Issue
Block a user