# ExernalProject.cmake typo?

**URL:** https://discourse.cmake.org/t/exernalproject-cmake-typo/2792
**Category:** Development
**Created:** [February 17, 2021, 9:34pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792 "2021-02-17T21:34:20Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![mwilbur](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mwilbur/32/1212_2.png) [@mwilbur](https://discourse.cmake.org/u/mwilbur)
#### Post date: [February 17, 2021, 9:34pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/1 "2021-02-17T21:34:20Z")

</div>

I was investigating why a patch step was not running using FetchContent.  
Is it possible line 3900 has a typo?

```auto
foreach(step IN ITEMS download update parse)

```

Should that `parse` be a `patch`?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 17, 2021, 9:42pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/2 "2021-02-17T21:42:58Z")

</div>

Yes, that looks like it should be `patch`. Feel free to submit [an MR](https://gitlab.kitware.com/cmake/cmake/-/merge_requests).

Cc: @craig.scott

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 17, 2021, 9:57pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/3 "2021-02-17T21:57:35Z")

</div>

Yes that’s a regression introduced in CMake 3.20.0-rc1. I’ll put up a fix myself shortly. Thanks for spotting it.

---

<div class="post-metadata">

### Author: ![mwilbur](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mwilbur/32/1212_2.png) [@mwilbur](https://discourse.cmake.org/u/mwilbur)
#### Post date: [February 17, 2021, 10:47pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/4 "2021-02-17T22:47:26Z")

</div>

I need to research the documents on how patch application is handled too, since the patch step is getting run all the time. The .cmake script is always newer than the stamp and the stamp depends on the .cmake script.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 17, 2021, 11:10pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/5 "2021-02-17T23:10:35Z")

</div>

The patch command depends on the update command. The update command always runs because it has to check if any update needs to be applied (things external to the build can change, like the upstream repo that the download step uses could have had more commits added, branches and tags moved, etc). Since the update step is always seen as out of date, the patch command will also always run. I think the only exception to this is if there is no update command (a URL download method would fall into this category). In that case, the update step is not always treated as out of date, so the patch command should only run if the download details change or after the first download.

If you are seeing the patch step running now where it didn’t with CMake 3.19, please report that as a regression in the [issue tracker](https://gitlab.kitware.com/cmake/cmake/-/issues).

---

<div class="post-metadata">

### Author: ![mwilbur](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mwilbur/32/1212_2.png) [@mwilbur](https://discourse.cmake.org/u/mwilbur)
#### Post date: [February 17, 2021, 11:12pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/6 "2021-02-17T23:12:28Z")

</div>

Am currently building 3.19 to test just that. Will file an issue if need be.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 17, 2021, 11:13pm UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/7 "2021-02-17T23:13:37Z")

</div>

I think you may be right though. I think I see why you are seeing the time stamps getting updated when they shouldn’t be. It will affect more than just the patch command too. 😞

---

<div class="post-metadata">

### Author: ![mwilbur](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mwilbur/32/1212_2.png) [@mwilbur](https://discourse.cmake.org/u/mwilbur)
#### Post date: [February 18, 2021, 12:46am UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/8 "2021-02-18T00:46:02Z")

</div>

I’m still trying to come up with a simple failing test case.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 18, 2021, 12:47am UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/9 "2021-02-18T00:47:09Z")

</div>

Don’t spend too long on that, I’m already part way through creating a test case and already have the fix (it’s small).

---

<div class="post-metadata">

### Author: ![mwilbur](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mwilbur/32/1212_2.png) [@mwilbur](https://discourse.cmake.org/u/mwilbur)
#### Post date: [February 18, 2021, 12:48am UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/10 "2021-02-18T00:48:54Z")

</div>

I have it now. It was worth it just as a learning exercise.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [February 18, 2021, 1:32am UTC](https://discourse.cmake.org/t/exernalproject-cmake-typo/2792/11 "2021-02-18T01:32:39Z")

</div>

I’ll have to wait to put up the fix for this timestamp issue, as it relies on the earlier fix for the patch command typo. Should find its way to being merged in a couple of days.
