You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
include(ExternalProject)
# Define the URL of the file you want to downloadset(FILE_URL "https://example.com/path/to/your/file.zip")
# Define where you want to extract the downloaded fileset(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 targetadd_custom_target(download_and_extract
DEPENDS my_download_and_extract_target
)
The text was updated successfully, but these errors were encountered:
example cmake:
The text was updated successfully, but these errors were encountered: