-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[r8brain-free-src] add new port #42256
base: master
Are you sure you want to change the base?
Changes from 2 commits
b051336
482b90e
fe3f532
53997df
54216ad
21cc971
9fb7aa7
56085ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
cmake_minimum_required(VERSION 3.17) | ||
|
||
project(r8brain VERSION 6.5 LANGUAGES CXX C) | ||
|
||
option(R8B_INSTALL "Install library" ON) | ||
option(R8B_PFFFT "Use PFFFT" OFF) | ||
option(R8B_PFFFT_DOUBLE "Use PFFFT_DOUBLE" OFF) | ||
|
||
if(R8B_INSTALL) | ||
include(GNUInstallDirs) | ||
include(CMakePackageConfigHelpers) | ||
endif() | ||
|
||
file(GLOB_RECURSE _src *.h *.cpp *.c) | ||
|
||
set(_src | ||
r8bbase.cpp | ||
) | ||
if(R8B_PFFFT) | ||
list(APPEND _src pffft.cpp) | ||
endif() | ||
if(R8B_PFFFT_DOUBLE) | ||
list(APPEND _src pffft_double/pffft_double.c) | ||
endif() | ||
|
||
add_library(r8bsrc ${_src}) | ||
|
||
if(R8B_PFFFT) | ||
target_compile_definitions(r8bsrc PUBLIC R8B_PFFFT=1) | ||
endif() | ||
|
||
if(R8B_PFFFT_DOUBLE) | ||
target_compile_definitions(r8bsrc PUBLIC R8B_PFFFT_DOUBLE=1) | ||
endif() | ||
|
||
if(R8B_INSTALL) | ||
install(TARGETS r8bsrc | ||
EXPORT ${PROJECT_NAME}Targets | ||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL | ||
) | ||
target_include_directories(r8bsrc PUBLIC | ||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}>" | ||
) | ||
|
||
install(EXPORT ${PROJECT_NAME}Targets | ||
FILE "unofficial-${PROJECT_NAME}Config.cmake" | ||
NAMESPACE unofficial::r8brain:: | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${PROJECT_NAME} | ||
) | ||
|
||
file(GLOB _headers *.h *.inc) | ||
list(FILTER _headers EXCLUDE REGEX r8butil.h) | ||
if(NOT R8B_PFFFT) | ||
list(FILTER _headers EXCLUDE REGEX pffft.h) | ||
endif() | ||
install( | ||
FILES ${_headers} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/r8brain | ||
) | ||
if(R8B_PFFFT_DOUBLE) | ||
install( | ||
FILES pffft_double/pffft_double.h | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/r8brain/pffft_double | ||
) | ||
endif() | ||
endif() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a new line at the end of the file. |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,32 @@ | ||||||||||||
if(VCPKG_TARGET_IS_WINDOWS) | ||||||||||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||||||||||||
endif() | ||||||||||||
|
||||||||||||
vcpkg_from_github( | ||||||||||||
OUT_SOURCE_PATH SOURCE_PATH | ||||||||||||
REPO avaneev/r8brain-free-src | ||||||||||||
REF version-${VERSION} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
SHA512 ae2707aa76d3dc89153bbe755f134c497a6024d3bc06badbb078fe8bc5c7f09bfa277003c6915b341f35d86224930890abab89da0ebafb98722cf35f9a2222d9 | ||||||||||||
) | ||||||||||||
|
||||||||||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||||||||||||
FEATURES | ||||||||||||
pffft R8B_PFFFT | ||||||||||||
pffft-double R8B_PFFFT_DOUBLE | ||||||||||||
) | ||||||||||||
|
||||||||||||
vcpkg_cmake_configure( | ||||||||||||
SOURCE_PATH "${SOURCE_PATH}" | ||||||||||||
OPTIONS | ||||||||||||
-DR8B_PFFFT=${R8B_PFFFT} | ||||||||||||
-DR8B_PFFFT_DOUBLE=${R8B_PFFFT_DOUBLE} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
) | ||||||||||||
|
||||||||||||
vcpkg_cmake_install() | ||||||||||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-r8brain CONFIG_PATH lib/cmake/unofficial-r8brain) | ||||||||||||
vcpkg_copy_pdbs() | ||||||||||||
|
||||||||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||||||||||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "r8brain-free-src", | ||
"version": "6.5", | ||
"description": "High-quality pro audio resampler / sample rate conversion C++ library. Very fast, for both audio resampling and time-series interpolation.", | ||
"homepage": "https://github.com/avaneev/r8brain-free-src", | ||
"license": "MIT", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"pffft": { | ||
"description": "use the PFFFT" | ||
}, | ||
"pffft-double": { | ||
"description": "use the PFFFT DOUBLE" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "b88965228a33232aeed509d51f238d9b1e646b57", | ||
"version": "6.5", | ||
"port-version": 0 | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the prefix 'unofficial' to all your exports.