# CMake update

**URL:** <https://discourse.itk.org/t/cmake-update/870>\
**Category:** Engineering\
**Created:** [April 25, 2018, 9:04pm UTC](https://discourse.itk.org/t/cmake-update/870 "2018-04-25T21:04:18Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [April 25, 2018, 9:04pm UTC](https://discourse.itk.org/t/cmake-update/870/1 "2018-04-25T21:04:18Z")

</div>

Ubuntu 18.04 will soon be out. It comes with [CMake 3.10.2](https://launchpad.net/ubuntu/bionic/+source/cmake). We said we will require that version for ITK 5.0. I suppose now is a good time to start requiring it? Anyone wanting to do that patching? Saying that is just as synchronization mechanism to avoid duplication of work 😃  
@jhlegarreta I think this is relevant for your [effort](https://github.com/InsightSoftwareConsortium/ITKWikiExamples/pull/10) to update WikiExamples.

---

<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:** [April 26, 2018, 6:37am UTC](https://discourse.itk.org/t/cmake-update/870/2 "2018-04-26T06:37:32Z")

</div>

True, this was mentioned in the [minimum cmake version](https://discourse.itk.org/t/minimum-cmake-version-update/585/) thread at least.

**I can update that in ITK, ITKWikiExamples, and the remote modules** , given that I was last in modifying them concerning the [noncopyable](https://discourse.itk.org/t/noncopyable/648) topic.

So whenever the community gives green light to it, I’ll submit the patches. Not before next week.

Once that done, I can update the WikiExamples `CMakeLists` in the wiki itself. However, as discussed [here](https://github.com/InsightSoftwareConsortium/ITKWikiExamples/pull/10), this will still not be consistent with the tarballs located in Bill’s repository, and rather than sync’ing all wiki examples to actually match their current counterparts in [GitHub](https://github.com/InsightSoftwareConsortium/ITKWikiExamples) (which is unfeasible in practice now), the big challenge would be transitioning the remaining ones to [Sphinx](https://github.com/InsightSoftwareConsortium/ITKExamples) so that we avoid the current sync’ing burden.

---

<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:** [May 2, 2018, 4:17pm UTC](https://discourse.itk.org/t/cmake-update/870/3 "2018-05-02T16:17:40Z")

</div>

Done for

- **ITK** : [topic](http://review.source.kitware.com/#/c/23388/)
- **ITKExamples** : [PR 51](https://github.com/InsightSoftwareConsortium/ITKExamples/pull/51)
- **ITKSofwareGuide** : [PR 80](https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/pull/80)

Working on the remotes now.

---

<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:** [May 2, 2018, 4:51pm UTC](https://discourse.itk.org/t/cmake-update/870/4 "2018-05-02T16:51:35Z")

</div>

Thanks for working on it Jon!

---

<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:** [May 3, 2018, 12:53pm UTC](https://discourse.itk.org/t/cmake-update/870/5 "2018-05-03T12:53:30Z")

</div>

The dashboard build machines need to have their CMake version updated to at least 3.10.2 before that patch is merged. @seanm @blowekamp @fbudin @hjmjohnson can you check you build machines and give a green light when ready?

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [May 3, 2018, 12:56pm UTC](https://discourse.itk.org/t/cmake-update/870/6 "2018-05-03T12:56:19Z")

</div>

Unless this addresses a bug, this will be a low priority for me to update all our machines.

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [May 3, 2018, 3:32pm UTC](https://discourse.itk.org/t/cmake-update/870/7 "2018-05-03T15:32:51Z")

</div>

I’m ready!

Hans

---

<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:** [May 5, 2018, 11:19am UTC](https://discourse.itk.org/t/cmake-update/870/8 "2018-05-05T11:19:33Z")

</div>

PRs to set the `cmake_minimum_required` to **3.10.2** for the **remote modules** :

- [AnalyzeObjectMapIO](https://github.com/InsightSoftwareConsortium/itkAnalyzeObjectMap/pull/13): note that it’s the **examples** `CMakeLists.txt` and not the module one.
- [AnisotropicDiffusionLBR](https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR/pull/21)
- [BioCell](https://github.com/InsightSoftwareConsortium/ITKBioCell/pull/8)
- [Cuberille](https://github.com/InsightSoftwareConsortium/ITKCuberille/pull/33)
- [DVMeshNoise](https://github.com/InsightSoftwareConsortium/DVMeshNoise/pull/6)
- [FixedPointInverseDisplacementField](https://github.com/InsightSoftwareConsortium/ITKFixedPointInverseDisplacementField/pull/11)
- [GenericLabelInterpolator](https://github.com/InsightSoftwareConsortium/ITKGenericLabelInterpolator/pull/6)
- [HigherOrderAccurateGradient](https://github.com/InsightSoftwareConsortium/ITKHigherOrderAccurateGradient/blob/master/CMakeLists.txt): **has not** a `cmake_minimum_required` requirement.
- [IOFDF](https://github.com/InsightSoftwareConsortium/itkFDFImageIO/pull/17)
- [IOSTL](https://github.com/InsightSoftwareConsortium/ITKSTLMeshIO/pull/11)
- [IOTransformDCMTK](https://github.com/InsightSoftwareConsortium/ITKIOTransformDCMTK/pull/13)
- [IsotropicWavelets](https://github.com/phcerdan/ITKIsotropicWavelets/pull/75): note that this is the upstream fork, the ISC one needs to pull a number of commits @dzenanz, @hjmjohnson, @phcerdan
- [LabelErodeDilate](https://github.com/richardbeare/LabelErodeDilate/blob/master/CMakeLists.txt): **has not** a `cmake_minimum_required` requirement.
- [LesionSizingToolkit](https://github.com/InsightSoftwareConsortium/LesionSizingToolkit/pull/8)
- [MGHIO](https://github.com/Slicer/itkMGHImageIO/pull/22)
- [MinimalPathExtraction](https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/pull/38)
- [MorphologicalContourInterpolation](https://github.com/KitwareMedical/ITKMorphologicalContourInterpolation/pull/73)
- [MultipleImageIterator](https://github.com/KitwareMedical/MultipleImageIterator/pull/4)
- [NeuralNetworks](https://github.com/InsightSoftwareConsortium/ITKNeuralNetworks/pull/9)
- [ParabolicMorphology](https://github.com/InsightSoftwareConsortium/ITKParabolicMorphology/pull/12)
- [PerformanceBenchmarking](https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/pull/48)
- [PolarTransform]([https://github.com/InsightSoftwareConsortium/ITKPolarTransform/pull/10](https://github.com/InsightSoftwareConsortium/ITKPolarTransform/pull/10)
- [PrincipalComponentsAnalysis](https://github.com/InsightSoftwareConsortium/ITKPrincipalComponentsAnalysis/pull/9)
- [RLEImage](https://github.com/KitwareMedical/ITKRLEImage/pull/27)
- [SCIFIO](https://github.com/scifio/scifio-imageio/pull/47)
- [SimpleITKFilters](https://github.com/SimpleITK/ITKSimpleITKFilters/pull/10)
- [SkullStrip](https://github.com/lorensen/skullStrip/pull/5)
- [SmoothingRecursiveYvvGaussianFilter](https://github.com/InsightSoftwareConsortium/SmoothingRecursiveYvvGaussianFilter/blob/master/CMakeLists.txt): **has not** a `cmake_minimum_required` requirement.
- [SphinxExamples](https://github.com/InsightSoftwareConsortium/ITKExamples): **Done**.
- [SplitComponents](https://github.com/InsightSoftwareConsortium/ITKSplitComponents/pull/9)
- [Strain](https://github.com/KitwareMedical/ITKStrain/pull/15)
- [SubdivisionQuadEdgeMeshFilter](https://github.com/InsightSoftwareConsortium/itkSubdivisionQuadEdgeMeshFilter/blob/master/CMakeLists.txt): **has not** a `cmake_minimum_required` requirement.
- [TBBImageToImageFilter](https://github.com/InsightSoftwareConsortium/ITKTBBImageToImageFilter/blob/master/CMakeLists.txt): **has not** a `cmake_minimum_required` requirement.
- [TextureFeatures](https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/pull/56)
- [TwoProjectionRegistration](https://github.com/InsightSoftwareConsortium/ITKTwoProjectionRegistration/pull/5)
- VariationalRegistration: **has not** a `cmake_minimum_required` requirement.
- [WikiExamples](https://github.com/InsightSoftwareConsortium/ITKWikiExamples/pull/16): note that the module `CMakeLists.txt` **has not** a `cmake_minimum_required` requirement.

Additionally, the following have a **minimum ITK VERSION requirement** as well, e.g.

```auto
  find_package(ITK 4.9 REQUIRED)

```

- [ITKAnisotropicDiffusionLBR](https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR/blob/06cb7673290b915e6333b08040975695a8457a31/CMakeLists.txt#L5): **4.9**
- [ITKCuberille](https://github.com/InsightSoftwareConsortium/ITKCuberille/blob/30fa6aa81bcaeab3dac99c5a5e13861bf45d89a0/CMakeLists.txt#L5): **4.10**
- [ITKFixedPointInverseDisplacementField](https://github.com/InsightSoftwareConsortium/ITKFixedPointInverseDisplacementField/blob/aaa58210d5f35ba12f3c346816afb77c94e8666d/CMakeLists.txt#L6): **4.9**
- [ITKGenericLabelInterpolator](https://github.com/InsightSoftwareConsortium/ITKGenericLabelInterpolator/blob/ee6909c58d697bf8f2d38762e57252c2cf707ffd/CMakeLists.txt#L5): **4.9**
- [ITKIOTransformDCMTK](https://github.com/InsightSoftwareConsortium/ITKIOTransformDCMTK/blob/30846821b5aebb7a89043b091a912d968dfdf812/CMakeLists.txt#L6): **4.9**
- [ITKMorphologicalContourInterpolation](https://github.com/KitwareMedical/ITKMorphologicalContourInterpolation/blob/db8f498f873a568f833c1f77c8dde3b404c22c6e/CMakeLists.txt#L5) **4.9**
- [ITKTwoProjectionRegistration](https://github.com/InsightSoftwareConsortium/ITKTwoProjectionRegistration/blob/ed6dd00ac061795f4c622d74b6144e9563fddb4d/CMakeLists.txt#L5): **4.9**
- [ITKRLEImage](https://github.com/KitwareMedical/ITKRLEImage/blob/ab5c83aadd2f34861f0430324fd882b09a965b45/CMakeLists.txt#L5): **4.9**
- [ITKTextureFeatures](https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/6bf23987131e57dfafb9008cada32e739fac5d82/CMakeLists.txt#L5): **4.10**

**Do these need to be update to ITK 5.0?**

Also, do the **CMake policies** present across the `CMakeLists.txt` files need to be updated? If, yes, which is the policy to be enfored?

Once the PRs accepted, I’ll submit a topic to gerrit to update the commit hashes.

Thanks.

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [May 5, 2018, 11:38am UTC](https://discourse.itk.org/t/cmake-update/870/9 "2018-05-05T11:38:00Z")

</div>

WOW! Great work.

---

<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:** [May 5, 2018, 11:49am UTC](https://discourse.itk.org/t/cmake-update/870/10 "2018-05-05T11:49:21Z")

</div>

I don’t remember why we added minimum version to [RLEImage](https://github.com/KitwareMedical/ITKRLEImage/blob/ab5c83aadd2f34861f0430324fd882b09a965b45/CMakeLists.txt#L5), but I don’t think it needs to be updated.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [May 5, 2018, 11:35pm UTC](https://discourse.itk.org/t/cmake-update/870/11 "2018-05-05T23:35:59Z")

</div>

Awesome, Jon!

> [@jhlegarreta](#):
>
> Do these need to be update to ITK 5.0?

I do not think we should require ITK 5.0 unless it is really required, e.g. the ITK 5.0 C++11 scripts have been executed. This allows folks to still use the modules with older versions of ITK.

> [@jhlegarreta](#):
>
> Also, do the CMake policies present across the CMakeLists.txt files need to be updated? If, yes, which is the policy to be enfored?

Many of the CMake policies can be removed because they default to `NEW` when a newer version of CMake is required.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [May 6, 2018, 3:28am UTC](https://discourse.itk.org/t/cmake-update/870/12 "2018-05-06T03:28:50Z")

</div>

The GitHub external module CI image, `insighttoolkit/module-ci:latest` has been updated to CMake 3.11.1.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [May 6, 2018, 4:15am UTC](https://discourse.itk.org/t/cmake-update/870/13 "2018-05-06T04:15:15Z")

</div>

Great! @hjmjohnson @matt.mccormick you can update [ISC ITKIsotropicWavelets](https://github.com/InsightSoftwareConsortium/ITKIsotropicWavelets) from [upstream](https://github.com/phcerdan/ITKIsotropicWavelets). It includes cmake update, and the recently merged itkViewImage is removed.

The ITKv4 compatible is the branch: [https://github.com/phcerdan/ITKIsotropicWavelets/tree/ITK4.13-Compatible](https://github.com/phcerdan/ITKIsotropicWavelets/tree/ITK4.13-Compatible)

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [May 6, 2018, 10:20pm UTC](https://discourse.itk.org/t/cmake-update/870/14 "2018-05-06T22:20:04Z")

</div>

@phcerdan Should we just remove the fork?

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [May 6, 2018, 10:33pm UTC](https://discourse.itk.org/t/cmake-update/870/15 "2018-05-06T22:33:58Z")

</div>

> [@matt.mccormick](#):
>
> Should we just remove the fork?

That is a good discussion to have for remote modules in general (pinging @jhlegarreta). My personal opinion is that if the original author is active the InsightSoftwareConsortium fork just creates extra maintenance burden. But maybe don’t remove it from ISC, and keep it alive to open Pull Requests from there to the original repo, in case a general update for all modules is required (as @hjmjohnson did with the c++11 update).

---

<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:** [May 7, 2018, 5:08pm UTC](https://discourse.itk.org/t/cmake-update/870/16 "2018-05-07T17:08:48Z")

</div>

> [@matt.mccormick](#):
>
> I do not think we should require ITK 5.0 unless it is really required, e.g. the ITK 5.0 C++11 scripts have been executed. This allows folks to still use the modules with older versions of ITK.

All remotes have gone through the C++11 update process :-S

> [@matt.mccormick](#):
>
> The GitHub external module CI image, insighttoolkit/module-ci:latest has been updated to CMake 3.11.1.

Awesome. Thanks !

> [@phcerdan](#):
>
> That is a good discussion to have for remote modules in general (pinging @jhlegarreta). My personal opinion is that if the original author is active the InsightSoftwareConsortium fork just creates extra maintenance burden. But maybe don’t remove it from ISC, and keep it alive to open Pull Requests from there to the original repo, in case a general update for all modules is required (as @hjmjohnson did with the c++11 update).

Yes, this is something that should be agreed upon to set a policy. @phcerdan is right in that it creates extra maintenance if the author is active. I tend to think that forks outside ISC and which are not active do also create extra maintenance and delays 🙂

Then we should **agree what being active means in this respect** : 6-months, or 1-year without commits?

Not skilled at this, but is it feasible to think about some script for these maintenance/sync/upstream pull issues?

OTOH, is it advised to have the `cmake_minimum_required` updated for these ITK(Kitware)-related projects as well?

- [KWStyle](https://github.com/Kitware/KWStyle)

- ThirdParties? GDCM? @mathieu.malaterre

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [May 7, 2018, 5:54pm UTC](https://discourse.itk.org/t/cmake-update/870/17 "2018-05-07T17:54:15Z")

</div>

> [@jhlegarreta](#):
>
> Then we should agree what being active means in this respect: 6-months, or 1-year without commits?

This is a good idea. How about 1 month?

> [@jhlegarreta](#):
>
> OTOH, is it advised to have the cmake\_minimum\_required updated for these ITK(Kitware)-related projects as well?
> 
> KWStyle

We could bump KWStyle.

Another option for _ITKIsotropicWavelets_ is to [transfer the repository](https://help.github.com/articles/transferring-a-repository-owned-by-your-personal-account/) to the _InsightSoftwareConsortium_.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [May 7, 2018, 7:32pm UTC](https://discourse.itk.org/t/cmake-update/870/18 "2018-05-07T19:32:21Z")

</div>

> [@matt.mccormick](#):
>
> Another option for ITKIsotropicWavelets is to transfer the repository to the InsightSoftwareConsortium.

I will be happy about this if I keep admin privileges on this one!

> [@matt.mccormick](#):
>
> This is a good idea. How about 1 month?

1 month without commits seems too short to me if the repo is stable. I mean, the maintainer can be active, but not actively working on the external module because there are no open issues, etc.

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [May 7, 2018, 7:59pm UTC](https://discourse.itk.org/t/cmake-update/870/19 "2018-05-07T19:59:28Z")

</div>

> [@phcerdan](#):
>
> Another option for ITKIsotropicWavelets is to transfer the repository to the InsightSoftwareConsortium.
> 
> I will be happy about this if I keep admin privileges on this one!

Great! Certainly, you will keep admin privileges. Since you are member of the _InsightSoftwareConsortium_ GitHub Org, I think you should be able to transfer the repository, according [to this documentation](https://help.github.com/articles/repository-permission-levels-for-an-organization/#creating-repositories). Please let us know if you have any issues.

> [@phcerdan](#):
>
> This is a good idea. How about 1 month?
> 
> 1 month without commits seems too short to me if the repo is stable. I mean, the maintainer can be active, but not actively working on the external module because there are no open issues, etc.

Agreed – fork if no activity in over 1 year?

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [May 7, 2018, 10:33pm UTC](https://discourse.itk.org/t/cmake-update/870/20 "2018-05-07T22:33:44Z")

</div>

> [@matt.mccormick](#):
>
> Agreed – fork if no activity in over 1 year?

Sounds good, and we can open an issue and ask directly to confirm.

> [@matt.mccormick](#):
>
> I think you should be able to transfer the repository, according to this documentation. Please let us know if you have any issues.

Cool, I will do it next week.

[Next page](https://discourse.itk.org/t/cmake-update/870.md?page=2)
