Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically download Runge-Kutta on build #19

Open
krystophny opened this issue Nov 20, 2023 · 0 comments
Open

Automatically download Runge-Kutta on build #19

krystophny opened this issue Nov 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@krystophny
Copy link
Member

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
)
@krystophny krystophny added the enhancement New feature or request label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant