# Unable to include qSlicerSegmentationsEditorEffects when building extension

**URL:** <https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371>\
**Category:** Development\
**Tags:** segmentation, extensions-manager\
**Created:** [December 3, 2019, 6:55pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371 "2019-12-03T18:55:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Netta\_Z](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/netta_z/32/4697_2.png) [@Netta\_Z](https://discourse.slicer.org/u/Netta_Z)\
**Post date:** [December 3, 2019, 6:55pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/1 "2019-12-03T18:55:49Z")

</div>

Hi, I’m trying to implement an editor effect as part of an extension. I’m having issues with accessing files from the qSlicerSegmentationsEditorEffects directory by declaring it in MODULE\_INCLUDE\_DIRECTORIES like so: `${qSlicerSegmentationsEditorEffects_INCLUDE_DIRS}` which I have seen this done in the segmentations module. However the directory was not accessible after cmake has configured and generated successfully. I tried declaring `${qSlicerSegmentationsModules_INCLUDE_DIRS}\EditorEffects` instead, but this only allowed me to access files in Slicer’s build directory not the source directory. What can I do to fix that?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Netta\_Z](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/netta_z/32/4697_2.png) [@Netta\_Z](https://discourse.slicer.org/u/Netta_Z)\
**Post date:** [December 4, 2019, 5:28pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/2 "2019-12-04T17:28:43Z")

</div>

I managed to include \EditorEffects of the Slicer’s source directory in my build by doing this:

```
list(GET qSlicerSegmentationsModule_INCLUDE_DIRS 0 qSegmentationSource_DIR)
set(MODULE_INCLUDE_DIRECTORIES
  ${qSegmentationSource_DIR}/EditorEffects
}

```

However is there a preferred way to achieve this? Should I be referencing the EditorEffects API when I create a loadable editor effect?

---

<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:** [December 4, 2019, 5:58pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/3 "2019-12-04T17:58:07Z")

</div>

You can [print all CMake variables](https://stackoverflow.com/questions/9298278/cmake-print-out-all-accessible-variables-in-a-script) to see what variables you can use to specify the include directory.

---

<div class="post-metadata">

**Author:** ![Netta\_Z](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/netta_z/32/4697_2.png) [@Netta\_Z](https://discourse.slicer.org/u/Netta_Z)\
**Post date:** [December 4, 2019, 6:50pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/4 "2019-12-04T18:50:50Z")

</div>

Thanks for the reply. Following the instructions from your link I didn’t see a variable available for the editor effect directory specifically, which is why I was unsure if the qSlicerSegmentationsEditorEffects API was made “private” by design. Could you please confirm that it’s ok to reference the API the way I described in my previous post?

---

<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:** [December 4, 2019, 7:07pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/5 "2019-12-04T19:07:55Z")

</div>

The API is not private, you can make your effects based on existing C++ classes. If you can send a link to your source code then we can have a look at it and suggest how to make CMake work (and maybe expose more directories as CMake variables from Slicer).

---

<div class="post-metadata">

**Author:** ![Netta\_Z](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/netta_z/32/4697_2.png) [@Netta\_Z](https://discourse.slicer.org/u/Netta_Z)\
**Post date:** [December 4, 2019, 8:28pm UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/6 "2019-12-04T20:28:08Z")

</div>

Sounds good! Here’s the CMakeList of the effect module(WIP):  
[https://bitbucket.org/OrthopaedicBiomechanicsLab/slicersegmenteditorfastlogicaleffect/src/master/SegmentEditorFastLogical/CMakeLists.txt](https://bitbucket.org/OrthopaedicBiomechanicsLab/slicersegmenteditorfastlogicaleffect/src/master/SegmentEditorFastLogical/CMakeLists.txt)

---

<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:** [December 5, 2019, 2:24am UTC](https://discourse.slicer.org/t/unable-to-include-qslicersegmentationseditoreffects-when-building-extension/9371/7 "2019-12-05T02:24:49Z")

</div>

Thank you, this helped. I have a [potential fix](https://github.com/Slicer/Slicer/pull/1277), but @jcfr has to review first.
