# Need to update extensions that other extensions may depend on

**URL:** <https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228>\
**Category:** Development\
**Created:** [April 29, 2017, 12:47pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228 "2017-04-29T12:47:02Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [April 29, 2017, 12:47pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/1 "2017-04-29T12:47:02Z")

</div>

Extensions were failed to build last night that depend on extensions that don’t provide a (ExtensionName)Config.cmake file. The error is changed to a warning for now, so extension builds will succeed tomorrow, but developers who maintain extensions that other extensions may depend on, should make a small change in their CMakeLists.txt files.

Reason for the change: For importing path variables (library paths, python paths, etc.) from dependent extensions, find\_package() must be able to find the dependent extension.

How to make sure find\_package() can find a dependent extension: Add this line near the end of the top-level CMakeLists.txt (just before Slicer\_EXTENSION\_CPACK configuration, see [this example](https://github.com/Slicer/Slicer/blob/master/Utilities/Templates/Extensions/Default/CMakeLists.txt#L25)):

```
include(${Slicer_EXTENSION_GENERATE_CONFIG})
```

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [November 17, 2017, 5:42pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/2 "2017-11-17T17:42:51Z")

</div>

Hi Andras,

I added the line locally to all dependent extensions and build each one.

When I configure the extensions which has dependencies it still gives the following error:

```
CMake Warning at /Users/christian/sources/cpp/Slicer/Extensions/CMake/SlicerBlockAdditionalLauncherSettings.cmake:48 (MESSAGE):
  Dependent extension SlicerDevelopmentToolbox DCMQI PETDICOMExtension cannot
  be found by CMake find_package(), therefore paths variables cannot be
  imported from this extension. The problem can be resolved by generating
  SlicerDevelopmentToolbox DCMQI PETDICOMExtensionConfig.cmake by adding
  include(${Slicer_EXTENSION_GENERATE_CONFIG}) to the top-level
  CMakeLists.txt of the dependent exension.
Call Stack (most recent call first):
  /Users/christian/sources/cpp/Slicer/Build/Slicer-build/UseSlicer.cmake:282 (include)
  CMakeLists.txt:19 (include)

```

Am I missing anything?

Christian

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [November 17, 2017, 6:17pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/3 "2017-11-17T18:17:46Z")

</div>

> [@che85](#):
>
> I added the line locally to all dependent extensions and build each one.

Note that at least some of those extensions already generate config file (I think dcmqi does, without using the line Andras mentioned), and also it appears that none of the extensions we maintain had build failures (see filtered list [here](http://slicer.cdash.org/index.php?project=Slicer4&display=project&filtercombine=and&filtercombine=and&filtercombine=or&filtercombine=or&filtercombine=or&filtercombine=or&filtercombine=or&filtercount=8&showfilters=1&filtercombine=or&field1=buildname&compare1=63&value1=DCMQI&field2=buildname&compare2=63&value2=OpenCV&field3=buildname&compare3=63&value3=PkModeling&field4=buildname&compare4=63&value4=SlicerProstate&field5=buildname&compare5=63&value5=-PET&field6=buildname&compare6=63&value6=SliceTracker&field7=buildname&compare7=63&value7=Radiomics&field8=buildname&compare8=63&value8=QuantitativeReporting)).

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [November 17, 2017, 6:47pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/4 "2017-11-17T18:47:27Z")

</div>

I added the line (for now only locally) for testing to all dependent extensions, but cmake still drops that error message when configuring QuantitativeReporting

---

<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:** [November 17, 2017, 8:23pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/5 "2017-11-17T20:23:37Z")

</div>

The \*Config.cmake file that Slicer generates contains directories that has to be added to AdditionalLauncherSettings.ini file. If you generate your own \*Config.cmake file already then you may need to disable that mechanism (when you build it as a Slicer extension) and use Slicer’s \*Config.cmake generator instead. You can inject your own content into the Slicer-generated \*Config.cmake files.

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [November 17, 2017, 9:29pm UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/6 "2017-11-17T21:29:10Z")

</div>

Ok and how do I do that?

---

<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:** [November 18, 2017, 1:10am UTC](https://discourse.slicer.org/t/need-to-update-extensions-that-other-extensions-may-depend-on/228/7 "2017-11-18T01:10:55Z")

</div>

To add custom content to your MyExtensionConfig.cmake file, set MyExtension\_CUSTOM\_CONFIG variable above `include(${Slicer_EXTENSION_GENERATE_CONFIG})`. See details and example here:

> <https://github.com/Slicer/Slicer/blob/master/CMake/SlicerExtensionGenerateConfig.cmake>
