# Min and max required CMake versions being defined but not re-used

**URL:** <https://discourse.itk.org/t/min-and-max-required-cmake-versions-being-defined-but-not-re-used/6112>\
**Category:** Engineering\
**Tags:** cmake\
**Created:** [July 29, 2023, 1:46pm UTC](https://discourse.itk.org/t/min-and-max-required-cmake-versions-being-defined-but-not-re-used/6112 "2023-07-29T13:46:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [July 29, 2023, 1:46pm UTC](https://discourse.itk.org/t/min-and-max-required-cmake-versions-being-defined-but-not-re-used/6112/1 "2023-07-29T13:46:43Z")

</div>

Hi,  
I’ve noticed that in the top-level `CMakeLists.txt` we are defining some min and max bounds for the required `CMake` versions, mainly labeled as having to do with `CMake` policies:  
[https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMakeLists.txt#L14](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMakeLists.txt#L14)

I assume these min and max versions should apply to any project within ITK, including the third parties or remotes. Please correct me if I’m wrong.

A quick search of the `cmake_minimum_required` string provides:  
[https://github.com/search?q=repo%3AInsightSoftwareConsortium%2FITK%20cmake\_minimum\_required&type=code](https://github.com/search?q=repo%3AInsightSoftwareConsortium%2FITK%20cmake_minimum_required&type=code)

That is, the variable defined in the top-level project is not used or propagated to othe `CMakeLists.txt` files within ITK.

Is there some reason for this? Am I missing something?

If it should be, I am happy to submit a PR.

Thanks.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [July 31, 2023, 4:05pm UTC](https://discourse.itk.org/t/min-and-max-required-cmake-versions-being-defined-but-not-re-used/6112/2 "2023-07-31T16:05:47Z")

</div>

I think that subdirectories inherit minimum version specification, so it is not needed to repeat it.

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [August 1, 2023, 12:24am UTC](https://discourse.itk.org/t/min-and-max-required-cmake-versions-being-defined-but-not-re-used/6112/3 "2023-08-01T00:24:04Z")

</div>

OK, not sure why we’ve been adding the command across different `CMakeLists.txt` files then.
