Merge branch 'aubio-cmake'

This commit is contained in:
Robert Schumacher 2017-06-28 13:56:40 -07:00
commit 9e1f1b20a0
3 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,90 @@
cmake_minimum_required(VERSION 3.8)
project(aubio C)
add_definitions(
-DHAVE_STDLIB_H=1
-DHAVE_STDIO_H=1
-DHAVE_MATH_H=1
-DHAVE_STRING_H=1
-DHAVE_LIMITS_H=1
-DHAVE_STDARG_H=1
-DHAVE_C99_VARARGS_MACROS=1
-DHAVE_SNDFILE=1
-DHAVE_WAVWRITE=1
-DHAVE_WAVREAD=1
-DHAVE_LIBAV=1
-DHAVE_SWRESAMPLE=1
)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_DEBUG_POSTFIX d)
option(BUILD_TOOLS "Build and install tools" ON)
set(TOOLS_INSTALLDIR "bin" CACHE STRING "Target directory for installed tools")
find_path(LIBSNDFILE_H sndfile.h)
find_library(LIBSNDFILE_LIB NAMES libsndfile-1 libsndfile)
find_library(AVCODEC_LIB avcodec)
find_library(AVUTIL_LIB avutil)
find_library(AVDEVICE_LIB avdevice)
find_library(AVFILTER_LIB avfilter)
find_library(AVFORMAT_LIB avformat)
find_library(SWRESAMPLE_LIB swresample)
find_library(OGG_LIB ogg)
find_library(FLAC_LIB flac)
find_library(VORBIS_LIB vorbis)
find_library(VORBISENC_LIB vorbisenc)
include_directories(src ${LIBSNDFILE_H})
file(GLOB_RECURSE SOURCES src/*.c)
set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h)
add_library(aubio ${SOURCES})
target_link_libraries(aubio PUBLIC
${LIBSNDFILE_LIB}
${OGG_LIB}
${FLAC_LIB}
${VORBIS_LIB}
${VORBISENC_LIB}
${AVCODEC_LIB}
${AVUTIL_LIB}
${AVDEVICE_LIB}
${AVFILTER_LIB}
${AVFORMAT_LIB}
${SWRESAMPLE_LIB}
ws2_32.lib
)
if(BUILD_TOOLS)
set(EXAMPLE_EXECS aubiomfcc aubionotes aubioonset aubiopitch aubioquiet aubiotrack)
foreach(EXAMPLE_EXEC ${EXAMPLE_EXECS})
add_executable(${EXAMPLE_EXEC} examples/${EXAMPLE_EXEC}.c examples/utils.c examples/jackio.c)
target_link_libraries(${EXAMPLE_EXEC} PRIVATE aubio)
target_compile_definitions(${EXAMPLE_EXEC} PRIVATE -DHAVE_WIN_HACKS=1)
endforeach()
install(
TARGETS ${EXAMPLE_EXECS}
RUNTIME DESTINATION ${TOOLS_INSTALLDIR}
)
endif()
install(
TARGETS aubio
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
if(NOT DISABLE_INSTALL_HEADERS)
install(
DIRECTORY src/
DESTINATION include/aubio
FILES_MATCHING
PATTERN "*.h"
PATTERN "*_priv.h" EXCLUDE
PATTERN "config.h" EXCLUDE
)
endif()

4
ports/aubio/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: aubio
Version: 0.46~alpha
Description: Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.
Build-Depends: ffmpeg, libsndfile, libogg, libflac, libvorbis

View File

@ -0,0 +1,34 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aubio-3c230fae309e9ea3298783368dd71bae6172359a)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/aubio/aubio/archive/3c230fae309e9ea3298783368dd71bae6172359a.zip"
FILENAME "aubio-0.4.6-3c230f.zip"
SHA512 081fe59612f0b1860f465208739b1377869c64b91cecf4a6f6fbdea19204b801c650ff956b34be5988ef1905f3546d3c55846037487e0b34b014f1adbb68629c
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_RELEASE
#-DTOOLS_INSTALLDIR=tools/aubio
-DBUILD_TOOLS=OFF
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=1
-DBUILD_TOOLS=OFF
)
vcpkg_install_cmake()
# Handle copyright and credentials
file(COPY
${SOURCE_PATH}/COPYING
${SOURCE_PATH}/AUTHORS
${SOURCE_PATH}/ChangeLog
${SOURCE_PATH}/README.md
DESTINATION
${CURRENT_PACKAGES_DIR}/share/aubio)
vcpkg_copy_pdbs()
file(RENAME ${CURRENT_PACKAGES_DIR}/share/aubio/COPYING ${CURRENT_PACKAGES_DIR}/share/aubio/copyright)