Skip to content
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

Use clap::helpers::Host #176

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/pullreq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
mkdir deps
cd deps
git clone https://github.com/free-audio/clap
git clone https://github.com/free-audio/clap-helpers
git clone https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
# temporary workaround, switch to vst3 sdk 3.7.7
Expand All @@ -39,7 +40,7 @@ jobs:
- name: Build project
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCLAP_SDK_ROOT=deps/clap -DVST3_SDK_ROOT=deps/vst3sdk -DCLAP_WRAPPER_OUTPUT_NAME=testplug
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCLAP_SDK_ROOT=deps/clap -DCLAP_HELPERS_SDK_ROOT=deps/clap-helpers -DVST3_SDK_ROOT=deps/vst3sdk -DCLAP_WRAPPER_OUTPUT_NAME=testplug
cmake --build ./build --config Debug
- name: Show Build Results
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# complete description
#
# CLAP_SDK_ROOT The location of the clap library. Defaults to ../clap
# CLAP_HELPERS_SDK_ROOT The location of the clap-helpers library. Defaults to ../clap-helpers
# VST3_SDK_ROOT The location of the VST3 sdk. Defaults tp ../vst3sdk
#
# CLAP_WRAPPER_OUTPUT_NAME The name of the resulting .vst3 or .component
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ git clone https://github.com/free-audio/clap-wrapper.git
mkdir build
cmake -B build \
-DCLAP_SDK_ROOT={path to clap sdk} \
-DCLAP_HELPERS_SDK_ROOT={path to clap-helpers sdk} \
-DVST3_SDK_ROOT={path to vst3 sdk} \
-DCLAP_WRAPPER_OUTPUT_NAME="The Name of your CLAP"
```
Expand Down
35 changes: 35 additions & 0 deletions cmake/base_sdks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,41 @@ function(guarantee_clap)
add_subdirectory(${CLAP_SDK_ROOT} base-sdk-clap EXCLUDE_FROM_ALL)
endfunction(guarantee_clap)

function(guarantee_clap_helpers)
if (TARGET clap-helpers)
if (NOT TARGET base-sdk-clap-helpers)
add_library(base-sdk-clap-helpers ALIAS clap-helpers)
endif()
return()
endif()


if (NOT "${CLAP_HELPERS_SDK_ROOT}" STREQUAL "")
# Use the provided root
elseif (${CLAP_WRAPPER_DOWNLOAD_DEPENDENCIES})
guarantee_cpm()
CPMAddPackage(
NAME "clap-helpers"
GITHUB_REPOSITORY "free-audio/clap-helpers"
GIT_TAG "7b53a685e11465154b4ccba3065224dbcbf8a893"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a problem, @baconpaul ?
Actually I'd like to use a version tag / branch here (instead of commit hash) but we do not have that for clap-helpers yet

EXCLUDE_FROM_ALL TRUE
DOWNLOAD_ONLY TRUE
SOURCE_DIR cpm/clap-helpers
)
set(CLAP_HELPERS_SDK_ROOT "${CMAKE_CURRENT_BINARY_DIR}/cpm/clap-helpers")
else()
search_for_sdk_source(SDKDIR clap-helpers RESULT CLAP_HELPERS_SDK_ROOT)
endif()

cmake_path(CONVERT "${CLAP_HELPERS_SDK_ROOT}" TO_CMAKE_PATH_LIST CLAP_HELPERS_SDK_ROOT)
if(NOT EXISTS "${CLAP_HELPERS_SDK_ROOT}/include/clap/helpers/macros.hh")
message(FATAL_ERROR "There is no CLAP_HELPERS SDK at ${CLAP_HELPERS_SDK_ROOT}. Please set CLAP_HELPERS_SDK_ROOT appropriately ")
endif()

message(STATUS "clap-wrapper: Configuring clap-helpers sdk")
add_subdirectory(${CLAP_HELPERS_SDK_ROOT} base-sdk-clap-helpers EXCLUDE_FROM_ALL)
endfunction(guarantee_clap_helpers)

function(guarantee_vst3sdk)
if (TARGET base-sdk-vst3)
return()
Expand Down
2 changes: 1 addition & 1 deletion cmake/shared_prologue.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function(guarantee_clap_wrapper_shared)
src/detail/clap/fsutil.cpp
src/detail/clap/automation.h
)
target_link_libraries(clap-wrapper-shared-detail PUBLIC clap clap-wrapper-extensions clap-wrapper-compile-options)
target_link_libraries(clap-wrapper-shared-detail PUBLIC clap clap-helpers clap-wrapper-extensions clap-wrapper-compile-options)
target_include_directories(clap-wrapper-shared-detail PUBLIC libs/fmt)
target_include_directories(clap-wrapper-shared-detail PUBLIC src)

Expand Down
1 change: 1 addition & 0 deletions cmake/wrapper_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ include(cmake/shared_prologue.cmake)
include(cmake/base_sdks.cmake)

guarantee_clap()
guarantee_clap_helpers()
guarantee_clap_wrapper_shared()


Expand Down
Loading
Loading