mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-02 14:50:17 +01: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,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} )
|
||||
if( required )
|
||||
set( ${enable} YES )
|
||||
else()
|
||||
option( ${enable} "Enable ${name} library" ON )
|
||||
else()
|
||||
set( ${enable} 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 )
|
||||
endif()
|
||||
|
||||
if( NOT ${${enable}} )
|
||||
# Bail if the target isn't enabled.
|
||||
if( NOT ${enable} )
|
||||
message( STATUS "========== ${name} disabled ==========" )
|
||||
return()
|
||||
endif()
|
||||
|
||||
# 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" )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
@@ -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} )
|
||||
|
||||
@@ -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} )
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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( TARGET_ROOT "${libsrc}/${TARGET}" )
|
||||
|
||||
set( SOURCES
|
||||
${TARGET_SOURCE}/PipeServer.cpp
|
||||
${TARGET_SOURCE}/ScripterCallback.cpp
|
||||
)
|
||||
# This defines the #define on both Windows and Linux.
|
||||
add_definitions( -DBUILDING_SCRIPT_PIPE )
|
||||
add_library( ${TARGET} MODULE ${SOURCES})
|
||||
message( STATUS "========== Configuring ${TARGET} ==========" )
|
||||
|
||||
target_include_directories( ${TARGET} PRIVATE
|
||||
${top_dir}/win
|
||||
def_vars()
|
||||
|
||||
add_library( ${TARGET} MODULE )
|
||||
|
||||
list( APPEND SOURCES
|
||||
PRIVATE
|
||||
${TARGET_ROOT}/PipeServer.cpp
|
||||
${TARGET_ROOT}/ScripterCallback.cpp
|
||||
)
|
||||
|
||||
target_link_libraries( ${TARGET} ${wxWidgets_LIBRARIES})
|
||||
list( APPEND INCLUDES
|
||||
PUBLIC
|
||||
${TARGET_ROOT}
|
||||
)
|
||||
|
||||
list( APPEND DEFINES
|
||||
PRIVATE
|
||||
BUILDING_SCRIPT_PIPE
|
||||
)
|
||||
|
||||
list( APPEND LIBRARIES
|
||||
PRIVATE
|
||||
wxwidgets
|
||||
Audacity
|
||||
)
|
||||
|
||||
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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
@@ -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} )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user