# ITKModuleExternal.cmake is not published with sudo make install

**URL:** <https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208>\
**Category:** Beginner Questions\
**Tags:** cmake\
**Created:** [September 14, 2023, 9:54pm UTC](https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208 "2023-09-14T21:54:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yziquel](https://discourse.itk.org/letter_avatar_proxy/v4/letter/y/d9b06d/32.png) [@yziquel](https://discourse.itk.org/u/yziquel)\
**Post date:** [September 14, 2023, 9:54pm UTC](https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208/1 "2023-09-14T21:54:55Z")

</div>

Hi.

I’ve got an issue that is reported in the following github issues:

> <https://github.com/InsightSoftwareConsortium/ITK/issues/4211#issuecomment-1720176782>
>
> \### Description
> 
> I tried to build \`itk-wasm\` after having built \`ITK\`. It fail…s at the \`cmake ..\` step since it cannot find \`ITKModuleExternal.cmake\`. The issue has been reported here:
> 
> https://github.com/InsightSoftwareConsortium/itk-wasm/issues/933
> 
> \### Steps to Reproduce
> 
> Build \`ITK\` on Ubuntu 22 with \`cmake .. && make && sudo make install\` and then build \`itk-wasm\` with \`cmake ..\`. Here are the revisions:
> 
> \`ITK\`: \`aaa43159aa5510fd514c71823b6b9c86b1f01212\`\`
> \`itk-wasm\`: \`b1289e36d0b2483c8687d9325fb16ed604be4b15\`
> 
> \### Expected behavior
> 
> The \`itk-wasm\` build would pass the \`cmake ..\`step.
> 
> \### Actual behavior
> 
> It fails to find \`ITKModuleExternal.cmake\`. Log is here:
> 
> https://github.com/InsightSoftwareConsortium/itk-wasm/issues/933
> 
> \### Reproducibility
> 
> Deterministic.
> 
> \### Versions
> 
> Revision SHAs have been given above.
> 
> \### Environment
> 
> Ubuntu 22 on an amd64.

> <https://github.com/InsightSoftwareConsortium/itk-wasm/issues/933>
>
> I just built ITK from source with \`cmake ..\`and \`make\` followed by \`sudo make in…stall\`. I hoped to pull all ITK dependencies this way. It appears not:
> 
> \`\`\`console
> mini-me@virtucon ~/h/c/i/build (main)\> cmake ..
> \-- The C compiler identification is GNU 11.4.0
> \-- The CXX compiler identification is GNU 11.4.0
> \-- Detecting C compiler ABI info
> \-- Detecting C compiler ABI info - done
> \-- Check for working C compiler: /usr/bin/cc - skipped
> \-- Detecting C compile features
> \-- Detecting C compile features - done
> \-- Detecting CXX compiler ABI info
> \-- Detecting CXX compiler ABI info - done
> \-- Check for working CXX compiler: /usr/bin/c++ - skipped
> \-- Detecting CXX compile features
> \-- Detecting CXX compile features - done
> CMake Warning (dev) at /usr/share/cmake-3.22/Modules/CTest.cmake:50 (option):
> Policy CMP0077 is not set: option() honors normal variables. Run "cmake
> --help-policy CMP0077" for policy details. Use the cmake\_policy command to
> set the policy and suppress this warning.
> 
> For compatibility with older versions of CMake, option is clearing the
> normal variable 'BUILD\_TESTING'.
> Call Stack (most recent call first):
> build/\_deps/libcbor-src/CMakeLists.txt:4 (include)
> This warning is for project developers. Use -Wno-dev to suppress it.
> 
> \-- Looking for sys/types.h
> \-- Looking for sys/types.h - found
> \-- Looking for stdint.h
> \-- Looking for stdint.h - found
> \-- Looking for stddef.h
> \-- Looking for stddef.h - found
> \-- Check size of size\_t
> \-- Check size of size\_t - done
> \-- LTO is enabled
> \-- Looking for ldexp
> \-- Looking for ldexp - found
> \-- Performing Test COMPILER\_HAS\_HIDDEN\_VISIBILITY
> \-- Performing Test COMPILER\_HAS\_HIDDEN\_VISIBILITY - Success
> \-- Performing Test COMPILER\_HAS\_HIDDEN\_INLINE\_VISIBILITY
> \-- Performing Test COMPILER\_HAS\_HIDDEN\_INLINE\_VISIBILITY - Success
> \-- Performing Test COMPILER\_HAS\_DEPRECATED\_ATTR
> \-- Performing Test COMPILER\_HAS\_DEPRECATED\_ATTR - Success
> CMake Error at CMakeLists.txt:126 (include):
> include could not find requested file:
> 
> ITKModuleExternal
> 
> 
> CMake Error at CMakeLists.txt:130 (itk\_module\_target\_label):
> Unknown CMake command "itk\_module\_target\_label".
> 
> 
> \-- Configuring incomplete, errors occurred!
> See also "/home/mini-me/home/cellar/itk-wasm/build/CMakeFiles/CMakeOutput.log".
> \`\`\`
> 
> This is likely a problem in ITK itself, but as it impacts itk-wasm, it seems not incorrect to open an issue here.

Roughly put: I am trying to build ITK and itk-wasm from source, living on the git repo head. The ITKModuleExternal.cmake file is supposed to come from ITK and to be consumed by itk-wasm. However, nothing I try with the usual cmake procedure manages to get this ITKModuleExternal.cmake file published. It hence is not consumed by itk-wasm.

What is the known, standard and/or documented way to get this done ? Or should I resort to manual or not-so-manual hacks ? Seems to me like a cmake configuration issue in ITK repo.

Please advise.

---

<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 15, 2023, 1:38pm UTC](https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208/2 "2023-09-15T13:38:26Z")

</div>

ITK itself builds fine, and is thoroughly tested. The issue most likely comes from itk-wasm’s build system, or the way you are invoking it. @matt.mccormick might know more.

---

<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:** [September 22, 2023, 8:27pm UTC](https://discourse.itk.org/t/itkmoduleexternal-cmake-is-not-published-with-sudo-make-install/6208/3 "2023-09-22T20:27:06Z")

</div>

Hi,

In summary, the file _ITKModuleExternal.cmake_’s purpose to to enabling an ITK module that lives in a repository separate from ITK, to be built against an ITK build tree. It is intentionally not added to the install tree.
