# SlicerCustomAppTemplate build fails on Loadable Module

**URL:** <https://discourse.slicer.org/t/slicercustomapptemplate-build-fails-on-loadable-module/24939>\
**Category:** Development\
**Tags:** bug\
**Created:** [August 26, 2022, 6:44pm UTC](https://discourse.slicer.org/t/slicercustomapptemplate-build-fails-on-loadable-module/24939 "2022-08-26T18:44:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandus1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brandus1/32/13776_2.png) [@brandus1](https://discourse.slicer.org/u/brandus1)\
**Post date:** [August 26, 2022, 6:44pm UTC](https://discourse.slicer.org/t/slicercustomapptemplate-build-fails-on-loadable-module/24939/1 "2022-08-26T18:44:20Z")

</div>

I have a SlicerCustomApplication with a loadable module with this tree structure:

```auto
.
├── CMakeLists.txt
├── Logic
│ ├── CMakeLists.txt
│ ├── vtkKernelFeedMultiply.cxx
│ ├── vtkKernelFeedMultiply.h
│ ├── vtkSlicerFeedMultiplyLogic.cxx
│ └── vtkSlicerFeedMultiplyLogic.h
├── Resources
│ ├── Icons
│ │ └── FeedMultiply.png
│ ├── UI
│ │ ├── qSlicerFeedMultiplyFooBarWidget.ui
│ │ └── qSlicerFeedMultiplyModuleWidget.ui
│ └── qSlicerFeedMultiplyModule.qrc
├── Testing
│ ├── CMakeLists.txt
│ └── Cxx
│ └── CMakeLists.txt
├── Widgets
│ ├── CMakeLists.txt
│ ├── qSlicerFeedMultiplyFooBarWidget.cxx
│ └── qSlicerFeedMultiplyFooBarWidget.h
├── build.sh
├── qSlicerFeedMultiplyModule.cxx
├── qSlicerFeedMultiplyModule.h
├── qSlicerFeedMultiplyModuleWidget.cxx
└── qSlicerFeedMultiplyModuleWidget.h

```

the customapp always built correctly while this module was bundled in an Extension. Now for development reasons I had to take this out of such extension and add it directly through the cmake `Slicer_EXTENSION_SOURCE_DIRS` variable in the app CMakeLists.txt.

Now the build fails with:

```auto
/opt/p/Slicer-build/E/FeedMultiply/qSlicerFeedMultiplyModuleWidgetGenericTest.cxx:51:10: fatal error: 'qSlicerFeedMultiplyModule.h' file not found
#include "qSlicerFeedMultiplyModule.h"
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [E/FeedMultiply/CMakeFiles/qSlicerFeedMultiplyModuleGenericCxxTests.dir/qSlicerFeedMultiplyModuleWidgetGenericTest.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/opt/p/Slicer-build/E/FeedMultiply/qSlicerFeedMultiplyModuleGenericTest.cxx:49:10: fatal error: 'qSlicerFeedMultiplyModule.h' file not found
#include "qSlicerFeedMultiplyModule.h"
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [E/FeedMultiply/CMakeFiles/qSlicerFeedMultiplyModuleGenericCxxTests.dir/qSlicerFeedMultiplyModuleGenericTest.cxx.o] Error 1
make[1]: *** [E/FeedMultiply/CMakeFiles/qSlicerFeedMultiplyModuleGenericCxxTests.dir/all] Error 2
make: *** [all] Error 2

```

A workaround is commenting the default flag `WITH_GENERIC_TESTS` in `slicerMacroBuildLoadableModule` in the module CMakeLists.txt. Then it build correctly

Any suggestion on why this happens?

Thank you very much

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 27, 2022, 10:35pm UTC](https://discourse.slicer.org/t/slicercustomapptemplate-build-fails-on-loadable-module/24939/2 "2022-08-27T22:35:41Z")

</div>

You can compare your CMakeLists.txt files with similar files in other extensions, such as in [SlicerIGT](https://github.com/SlicerIGT/SlicerIGT).
