Skip to content
Snippets Groups Projects
Commit a1a09fdb authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Sergey Kaplun
Browse files

cmake: fix warning in an ExternalProject_Add()

CMake 3.24+ produces a warning about the missed option
DOWNLOAD_EXTRACT_TIMESTAMP in `ExternalProject_Add()` [1]:

 | The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy
 | CMP0135 is not set.

Documentation about policy CMP0135 [2] said:

CMake 3.23 and below set the timestamps of the extracted contents
to the same as the timestamps in the archive. When the URL
changes, the new archive is downloaded and extracted, but the
timestamps of the extracted contents might not be newer than the
previous contents. Anything that depends on the extracted contents
might not be rebuilt, even though the contents may change.

CMake 3.24 and above prefer to set the timestamps of all
extracted contents to the time of the extraction. This ensures
that anything that depends on the extracted contents will be
rebuilt whenever the URL changes.

1. https://cmake.org/cmake/help/latest/module/ExternalProject.html#url
2. https://cmake.org/cmake/help/latest/policy/CMP0135.html

NO_CHANGELOG=build
NO_DOC=build
NO_TEST=build

(cherry picked from commit 4c0e08d85cd39916818bc4b915ac3acdacce8fe4)
parent 42afb4b7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment