-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
33 lines (26 loc) · 965 Bytes
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.10)
project(SyftPythonDistributions NONE)
string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" OS_NAME)
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" CPU_NAME)
string(REPLACE "x86_64" "amd64" CPU_NAME "${CPU_NAME}")
string(REPLACE "aarch64" "arm64" CPU_NAME "${CPU_NAME}")
message(STATUS "OS: ${OS_NAME}, CPU: ${CPU_NAME}")
set(DL_EXT "tar.gz")
if("${OS_NAME}" STREQUAL "windows")
set(DL_EXT "zip")
endif()
include(FetchContent)
include(syft_version.cmake)
set(SYFT_INSTALL_DIR ${CMAKE_BINARY_DIR}/syft-install)
FetchContent_Declare(
syft
SOURCE_DIR ${SYFT_INSTALL_DIR}
URL https://github.com/anchore/syft/releases/download/v${SYFT_VERSION}/syft_${SYFT_VERSION}_${OS_NAME}_${CPU_NAME}.${DL_EXT}
#URL_HASH
#DOWNLOAD_EXTRACT_TIMESTAMP TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
FetchContent_MakeAvailable(syft)
install(PROGRAMS ${SYFT_INSTALL_DIR}/syft${CMAKE_EXECUTABLE_SUFFIX} DESTINATION bin)