# Registry edit error during CMake config

**URL:** <https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206>\
**Category:** Engineering\
**Created:** [September 6, 2024, 11:46pm UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206 "2024-09-06T23:46:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregsharp](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregsharp](https://discourse.itk.org/u/gregsharp)\
**Post date:** [September 6, 2024, 11:47pm UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/1 "2024-09-06T23:47:00Z")

</div>

Hi all, First, let me thank you for all the great software and support over the years!

Latest CMake and ITK. I am trying to configure and build on a Corporate Windows 10 computer that has (IMO) fairly mild lockdown of Admin rights. Any thoughts how to workaround the following error?

```auto
Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
ERROR: Registry editing has been disabled by your administrator.

CMake Error at CMakeLists.txt:82 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.

```

Thank you,  
Greg

---

<div class="post-metadata">

**Author:** ![gregsharp](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregsharp](https://discourse.itk.org/u/gregsharp)\
**Post date:** [September 6, 2024, 11:49pm UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/2 "2024-09-06T23:49:56Z")

</div>

Forgot to mention. CMake generate and build of DCMTK was not a problem. So I feel CMake might not be the problem.

---

<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:** [September 7, 2024, 12:31am UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/3 "2024-09-07T00:31:44Z")

</div>

You could try “adding an entry” called `ITK_SKIP_PATH_LENGTH_CHECKS` of type BOOL, and set it to OFF. See the logic here:

> <https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4.0/CMakeLists.txt#L78-L99>

---

<div class="post-metadata">

**Author:** ![gregsharp](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregsharp](https://discourse.itk.org/u/gregsharp)\
**Post date:** [September 7, 2024, 2:09am UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/4 "2024-09-07T02:09:10Z")

</div>

Thank you dzenanz. Regrettably that did not work.

I vaguely recall that ITK stores recently used source(?) build(?) paths in the registry, so that repeated builds from the same directories are more convenient. Might this be related?

---

<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:** [September 7, 2024, 11:17am UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/5 "2024-09-07T11:17:00Z")

</div>

What version of CMake are you using? Could it be too old, too new, customized somehow? This is the line 82 your error message blames:

> <https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4.0/CMakeLists.txt#L82>

---

<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:** [September 7, 2024, 11:17am UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/6 "2024-09-07T11:17:57Z")

</div>

Or maybe the `reg.exe` is different for you?

---

<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:** [September 16, 2024, 4:32pm UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/7 "2024-09-16T16:32:02Z")

</div>

Did you make any progress? Sharing the solution, if you have it, is good for posterity (people searching for a solution to a similar problem).

---

<div class="post-metadata">

**Author:** ![gregsharp](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/bc79bd/32.png) [@gregsharp](https://discourse.itk.org/u/gregsharp)\
**Post date:** [September 16, 2024, 11:41pm UTC](https://discourse.itk.org/t/registry-edit-error-during-cmake-config/7206/8 "2024-09-16T23:41:10Z")

</div>

Yes! I’m sorry I didn’t post back. Setting ITK\_SKIP\_PATH\_LENGTH\_CHECKS to ON did work, I made a mistake by not deleting the build directory the first time I tried that. Thank you Dzenan, this is Solved.
