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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Both these functions use the same tool - please mind that first function downloads single asset, whereas second one multiple ones
function(download_asset_release asset_name_in asset_name_out asset_repo asset_version cache_dir)
add_custom_command(OUTPUT ${asset_repo}
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/download_asset.py
--cache_dir ${cache_dir}
github
--owner mudita
--repository ${asset_repo}
--install_dir ${SYSROOT_BIN_PATH}
download
--name_in ${asset_name_in}
--name_out ${asset_name_out}
--product ${PRODUCT}
--version ${asset_version}
COMMENT "Downloading ${asset_name_out} to install dir: ${CMAKE_BINARY_DIR}"
)
add_custom_target(${asset_name_out}-target DEPENDS ${asset_repo})
# multicomp_install(PROGRAMS ${CMAKE_BINARY_DIR}/${asset_repo} DESTINATION "./" COMPONENTS Standalone Update)
endfunction()
function(download_asset_release_json
target
json
install_path
asset_repo
version
cache_dir
)
add_custom_target(
${target}
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/download_asset.py
--cache_dir ${cache_dir}
github
--owner mudita
--repository ${asset_repo}
--install_dir ${install_path}
download
--json ${json}
--version ${version}
--product ${PRODUCT}
COMMENT "Downloading ${target} from ${json} for ${PRODUCT} to install dir: ${install_path}"
)
endfunction()
function(download_asset_json
target
json
install_path
repository
cache_dir)
add_custom_target(${target}
COMMAND python3 ${CMAKE_SOURCE_DIR}/tools/download_asset.py
--cache_dir ${cache_dir}
github
--owner mudita
--repository ${repository}
--install_dir ${install_path}
json
--json ${json}
COMMENT "Download ${target} binary assets listed in ${json} for ${PRODUCT} to install dir: ${install_path}"
)
endfunction()