In CMake, at build-time, how can a project download some other piece of software without…
- User
In CMake, at build-time, how can a project download some other piece of software without building it?
- Assistant
In CMake, you can use the ExternalProject module to download and build external projects. However, if you only want to download the software without building it, you can use CMake's file DOWNLOAD command.
Here's a step-by-step guide on how to download software without building it at build-time using CMake:
-
Create a CMakeLists.txt file for your project if you haven't already.
-
In your CMakeLists.txt file, use the file DOWNLOAD command to download the software. The basic syntax of this command is:
codefile( DOWNLOAD <URL> <DESTINATION> [EXPECTED_HASH <EXPECTED_HASH>] [SHOW_PROGRESS] )
-