# Configuring the running environment for an extension build-tree

**URL:** <https://discourse.slicer.org/t/configuring-the-running-environment-for-an-extension-build-tree/43103>\
**Category:** Development\
**Tags:** extensions, cmake\
**Created:** [May 26, 2025, 2:01pm UTC](https://discourse.slicer.org/t/configuring-the-running-environment-for-an-extension-build-tree/43103 "2025-05-26T14:01:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [May 26, 2025, 2:01pm UTC](https://discourse.slicer.org/t/configuring-the-running-environment-for-an-extension-build-tree/43103/1 "2025-05-26T14:01:40Z")

</div>

Hello. Is there any reason for the following code not taking effect when added to a `External_something.cmake` file in a superbuild extension?

```auto
  set(${proj}_ENVVARS_LAUNCHER_BUILD
    "VAR1=${VAR1}"
    "VAR2=anything"
    )
  mark_as_superbuild(
    VARS ${proj}_ENVVARS_LAUNCHER_BUILD
    LABELS "ENVVARS_LAUNCHER_BUILD"
    )

```

This, in turn, works fine:

```auto
  # python paths
  set(${proj}_PYTHONPATH_LAUNCHER_BUILD
    ${EP_BINARY_DIR}/lib/python3/site-packages
    )
  mark_as_superbuild(
    VARS ${proj}_PYTHONPATH_LAUNCHER_BUILD
    LABELS "PYTHONPATH_LAUNCHER_BUILD"
    )

```

And I can see that the `AdditionalLauncherSettings.ini` file includes the expected path in the `PYTHONPATH` variable.

Any pointers? Thank you in advance.

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [May 26, 2025, 8:02pm UTC](https://discourse.slicer.org/t/configuring-the-running-environment-for-an-extension-build-tree/43103/2 "2025-05-26T20:02:19Z")

</div>

I’ve done some investigation and it seems to be a bug in the Slicer CMake infrastructure for generating the `AdditionalLauncherSettings.ini` file. I’ll come up with PR to solve this
