-
Notifications
You must be signed in to change notification settings - Fork 2
/
fetch_jamba.cmake
41 lines (36 loc) · 1.64 KB
/
fetch_jamba.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.19)
include(FetchContent)
set(JAMBA_GIT_REPO "https://github.com/pongasoft/jamba" CACHE STRING "Jamba git repository url")
set(JAMBA_GIT_TAG v7.1.3 CACHE STRING "Jamba git tag")
set(JAMBA_DOWNLOAD_URL "${JAMBA_GIT_REPO}/archive/refs/tags/v7.1.3.zip" CACHE STRING "Jamba download url")
set(JAMBA_DOWNLOAD_URL_HASH "SHA256=c177c031afebf97e3c8ccaf70e9de09a1cfbe4d4503e45106612cceef03f3fe0" CACHE STRING "Jamba download url hash")
if(JAMBA_ROOT_DIR)
message(STATUS "Using jamba from local ${JAMBA_ROOT_DIR}")
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_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"
SOURCE_SUBDIR "do_not_make_available"
)
else()
message(STATUS "Fetching jamba from ${JAMBA_DOWNLOAD_URL}")
FetchContent_Declare(jamba
URL "${JAMBA_DOWNLOAD_URL}"
URL_HASH "${JAMBA_DOWNLOAD_URL_HASH}"
DOWNLOAD_EXTRACT_TIMESTAMP true
SOURCE_DIR "${CMAKE_BINARY_DIR}/jamba"
SOURCE_SUBDIR "do_not_make_available"
)
endif()
endif()
FetchContent_MakeAvailable(jamba)
set(JAMBA_ROOT_DIR ${jamba_SOURCE_DIR})