Skip to content

Automatically download Runge-Kutta on build #19

@krystophny

Description

@krystophny

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
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions