-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
example cmake:
include(ExternalProject)
# Define the URL of the file you want to download
set(FILE_URL "https://example.com/path/to/your/file.zip")
# Define where you want to extract the downloaded file
set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/extracted")
# Create an ExternalProject target to download and extract the file
ExternalProject_Add(
my_download_and_extract_target
PREFIX ${CMAKE_BINARY_DIR}/download
URL ${FILE_URL}
URL_HASH SHA256=<insert_sha256_hash_of_file_here>
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/download
DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E tar xzf <DOWNLOADED_FILE> -C ${EXTRACT_DIR}
BUILD_IN_SOURCE 1
)
# Add a custom target that depends on the download and extract target
add_custom_target(download_and_extract
DEPENDS my_download_and_extract_target
)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request