Skip to main content

: Specific directory to store the downloaded file.

Using ExternalProject to download a header-only library - Code

While ExternalProject_Add is powerful, it has a major limitation: it runs at . This means the files aren't available until you actually start compiling.

To force ExternalProject_Add to stop after the download (and extraction) step, you must explicitly disable the subsequent steps by setting their commands to an empty string.

When downloading files, you often need control over where they go and how they are handled:

include(ExternalProject) ExternalProject_Add(my_assets # 1. Download Options URL "https://example.com" URL_HASH SHA256=abcdef123456... # Highly recommended for caching # 2. Disable standard build steps CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" TEST_COMMAND "" ) Use code with caution. Key Configuration Options

: Set to TRUE if you want to keep the archive (like a .tar.gz or .zip ) as-is rather than unpacking it.