Skip to site menu Skip to page content

Cmake Download [new]_no_extract [TOP]

: If the target URL is a direct download for a .jar , .exe , or .pdf file, CMake's automatic extraction will fail or produce an error because the file isn't a standard archive.

include(ExternalProject) ExternalProject_Add(MyTool URL https://example.com DOWNLOAD_NO_EXTRACT 1 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) Use code with caution. cmake download_no_extract

This is essential when working with files that are not archives (like .jar or .exe files) or when you need to handle extraction manually via a custom step. Core Usage and Syntax : If the target URL is a direct download for a

When you specify a URL in ExternalProject_Add or FetchContent_Declare , CMake defaults to assuming the file is a compressed archive (like .zip or .tar.gz ) and attempts to unpack it into the SOURCE_DIR . Adding DOWNLOAD_NO_EXTRACT 1 (or TRUE ) disables this behavior. ExternalProject Example Core Usage and Syntax When you specify a

: For extremely large archives where you only need the raw compressed file for a later build stage, skipping extraction saves significant disk space and time. Known Issues and Tips ExternalProject — CMake 4.3.2 Documentation