Skip to content

Commit

Permalink
tweaked fetch content code
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Dec 1, 2024
1 parent ed54169 commit 5b67d20
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Check the [Quickstart](https://jamba.dev/quickstart/) section to getting started
Latest Release
--------------

7.1.2 | 2024-11-26 | VST SDK 3.7.12+
7.1.3 | 2024-12-01 | VST SDK 3.7.12+

[Release notes (local)](RELEASE.md)

Expand Down
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Release Notes {#release-notes}

Check the [Requirements](https://jamba.dev/requirements/) documentation for information about which VST3 SDK Jamba supports and how to get it.

## [7.1.3 | 2024-12-01](https://github.com/pongasoft/jamba/tree/v7.1.3)

* Use `FetchContent_Populate`/`FetchContent_MakeAvailable` with `SOURCE_SUBDIR` option (see [CMake discussion](https://discourse.cmake.org/t/prevent-fetchcontent-makeavailable-to-execute-cmakelists-txt))

## [7.1.2 | 2024-11-26](https://github.com/pongasoft/jamba/tree/v7.1.2)

* Fixes issues with some DAWs on Windows when using the bundle format
Expand Down
20 changes: 9 additions & 11 deletions blank-plugin/fetch_jamba.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,33 @@ set(JAMBA_DOWNLOAD_URL_HASH "[-jamba_download_url_hash-]" CACHE STRING "Jamba do

if(JAMBA_ROOT_DIR)
message(STATUS "Using jamba from local ${JAMBA_ROOT_DIR}")
FetchContent_Populate(jamba
QUIET
SOURCE_DIR "${JAMBA_ROOT_DIR}"
BINARY_DIR "${CMAKE_BINARY_DIR}/jamba-build"
FetchContent_Declare(jamba
SOURCE_DIR "${JAMBA_ROOT_DIR}"
SOURCE_SUBDIR "do_not_make_available" # invalid folder to not execute jamba/CMakeLists.txt
)
else()
if(JAMBA_DOWNLOAD_URL STREQUAL "" OR JAMBA_DOWNLOAD_URL_HASH STREQUAL "")
message(STATUS "Fetching jamba from ${JAMBA_GIT_REPO}/tree/${JAMBA_GIT_TAG}")
FetchContent_Populate(jamba
QUIET
FetchContent_Declare(jamba
GIT_REPOSITORY ${JAMBA_GIT_REPO}
GIT_TAG ${JAMBA_GIT_TAG}
GIT_CONFIG advice.detachedHead=false
GIT_SHALLOW true
SOURCE_DIR "${CMAKE_BINARY_DIR}/jamba"
BINARY_DIR "${CMAKE_BINARY_DIR}/jamba-build"
SOURCE_SUBDIR "do_not_make_available"
)
else()
message(STATUS "Fetching jamba from ${JAMBA_DOWNLOAD_URL}")
FetchContent_Populate(jamba
QUIET
FetchContent_Declare(jamba
URL "${JAMBA_DOWNLOAD_URL}"
URL_HASH "${JAMBA_DOWNLOAD_URL_HASH}"
DOWNLOAD_EXTRACT_TIMESTAMP true
SOURCE_DIR "${CMAKE_BINARY_DIR}/jamba"
BINARY_DIR "${CMAKE_BINARY_DIR}/jamba-build"
SOURCE_SUBDIR "do_not_make_available"
)
endif()
endif()

set(JAMBA_ROOT_DIR ${jamba_SOURCE_DIR})
FetchContent_MakeAvailable(jamba)

set(JAMBA_ROOT_DIR ${jamba_SOURCE_DIR})
31 changes: 17 additions & 14 deletions cmake/JambaFetchContent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.19)

include(FetchContent)

# Note that this function only fetches the content and does NOT make it available
function(jamba_fetch_content)
set(oneValueArgs NAME GIT_REPO GIT_TAG DOWNLOAD_URL DOWNLOAD_URL_HASH ROOT_DIR)

Expand Down Expand Up @@ -54,36 +55,38 @@ function(jamba_fetch_content)

if(ARG_ROOT_DIR)
message(STATUS "Using ${ARG_NAME} from local ${ARG_ROOT_DIR}")
FetchContent_Populate(${ARG_NAME}
QUIET
SOURCE_DIR "${ARG_ROOT_DIR}"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-build"
FetchContent_Declare(${ARG_NAME}
SOURCE_DIR "${ARG_ROOT_DIR}"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-build"
SOURCE_SUBDIR "do_not_make_available" # invalid folder to not execute CMakeLists.txt
)
else()
if(ARG_DOWNLOAD_URL)
message(STATUS "Fetching ${ARG_NAME} from ${ARG_DOWNLOAD_URL}")
FetchContent_Populate( ${ARG_NAME}
QUIET
FetchContent_Declare( ${ARG_NAME}
URL "${ARG_DOWNLOAD_URL}"
URL_HASH "${ARG_DOWNLOAD_URL_HASH}"
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-build"
DOWNLOAD_EXTRACT_TIMESTAMP true
SOURCE_SUBDIR "do_not_make_available"
)
else()
message(STATUS "Fetching ${ARG_NAME} from ${ARG_GIT_REPO}/tree/${ARG_GIT_TAG}")
FetchContent_Populate(${ARG_NAME}
QUIET
GIT_REPOSITORY ${ARG_GIT_REPO}
GIT_TAG ${ARG_GIT_TAG}
GIT_CONFIG advice.detachedHead=false
GIT_SHALLOW true
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-build"
FetchContent_Declare(${ARG_NAME}
GIT_REPOSITORY ${ARG_GIT_REPO}
GIT_TAG ${ARG_GIT_TAG}
GIT_CONFIG advice.detachedHead=false
GIT_SHALLOW true
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${ARG_NAME}-build"
SOURCE_SUBDIR "do_not_make_available"
)
endif()
endif()

FetchContent_MakeAvailable(${ARG_NAME})

set(${ARG_NAME}_ROOT_DIR "${${ARG_NAME}_SOURCE_DIR}" PARENT_SCOPE)
set(${ARG_NAME}_SOURCE_DIR "${${ARG_NAME}_SOURCE_DIR}" PARENT_SCOPE)
set(${ARG_NAME}_BINARY_DIR "${${ARG_NAME}_BINARY_DIR}" PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/JambaFetchVST3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if(EXISTS "${VST3_SDK_ROOT}/${VSTSDK3_KNOWN_FILE}")
set(vst3sdk_SOURCE_DIR "${VST3_SDK_ROOT}")
endif()
elseif(JAMBA_DOWNLOAD_VSTSDK)
jamba_fetch_content(NAME vst3sdk GIT_REPO "${JAMBA_VST3SDK_GIT_REPO}" GIT_TAG "${JAMBA_VST3SDK_GIT_TAG}")
jamba_fetch_content(NAME vst3sdk GIT_REPO "${JAMBA_VST3SDK_GIT_REPO}" GIT_TAG "${JAMBA_VST3SDK_GIT_TAG}")
if(EXISTS "${JAMBA_VST3SDK_PATCH_DIR}")
internal_jamba_patch_vst3sdk("${JAMBA_VST3SDK_PATCH_DIR}" "${vst3sdk_SOURCE_DIR}")
else()
Expand Down
2 changes: 1 addition & 1 deletion jamba.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ endif()
#------------------------------------------------------------------------
set(JAMBA_MAJOR_VERSION 7)
set(JAMBA_MINOR_VERSION 1)
set(JAMBA_PATCH_VERSION 2)
set(JAMBA_PATCH_VERSION 3)
execute_process(COMMAND git describe --long --dirty --abbrev=10 --tags
RESULT_VARIABLE result
OUTPUT_VARIABLE JAMBA_GIT_VERSION
Expand Down

0 comments on commit 5b67d20

Please sign in to comment.