# Build module against Nightly Slicer

**URL:** <https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648>\
**Category:** Support\
**Tags:** nightlybuild, module\
**Created:** [February 5, 2019, 8:13pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648 "2019-02-05T20:13:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![siaeleni](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Post date:** [February 5, 2019, 8:13pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648/1 "2019-02-05T20:13:00Z")

</div>

Hello,

I want to build a module against Nightly Slicer at Release mode.

When I build the sln at VS I would expect to get generated the files at :  
moduleName\_build\lib\Slicer-4.11\cli-modules\Release  
path, but they are generated under :  
Slicer-build\lib\Slicer-4.11\cli-modules\Release

Can you explain me how can I change that path?  
Thanks

---

<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:** [February 5, 2019, 8:16pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648/2 "2019-02-05T20:16:11Z")

</div>

The build location for module .dll and .exe files is correct - Slicer-build\lib\Slicer-4.11\cli-modules\Release. Do not attempt to change this path, as the build system relies on finding files in this location.

---

<div class="post-metadata">

**Author:** ![siaeleni](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siaeleni](https://discourse.slicer.org/u/siaeleni)\
**Post date:** [February 5, 2019, 8:23pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648/3 "2019-02-05T20:23:40Z")

</div>

Ok, but why other modules, such as SlicerIGT, could be able to generate those files at  
Modules\SlicerIGT\_build\lib\Slicer-4.11\qt-loadable-modules\Release ?

---

<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:** [February 5, 2019, 8:39pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648/4 "2019-02-05T20:39:51Z")

</div>

I see, you mean CLI’s from your own extension. You can change the location of those to be within your build tree by adding these 3 lines of code:

> <https://github.com/SlicerRt/SlicerRT/blob/master/PlmBspline/CMakeLists.txt#L32-L34>

@jcfr Should we add these lines to the CLI module template?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 7, 2019, 7:04pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648/5 "2019-05-07T19:04:40Z")

</div>

@siaeleni and I just ran into this again generating a new cli. I think adding the OUTPUT\_DIRECTORY lines to the CLI template makes sense, but we should also add the corresponding lines to the [Loadable module template too.](https://github.com/Slicer/Slicer/blob/master/Utilities/Templates/Modules/Loadable/CMakeLists.txt#L48-L60) This should also include the python directory and any others?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 7, 2019, 7:41pm UTC](https://discourse.slicer.org/t/build-module-against-nightly-slicer/5648/6 "2019-05-07T19:41:59Z")

</div>

> [@lassoan](#):
>
> you mean CLI’s from your own extension. You can change the location of those to be within your build tree by adding these 3 lines of code:

I do not recommend specifying output directories directly as parameter of `SEMMacroBuildCLI`, when building a CLI extensions, reasonable default are already expected to be set.

To address this, I suggest we update the following:

[https://github.com/Slicer/Slicer/blob/57613e53bee81b1318c55f624dba46ad101c1bda/CMake/UseSlicer.cmake.in#L304-L306](https://github.com/Slicer/Slicer/blob/57613e53bee81b1318c55f624dba46ad101c1bda/CMake/UseSlicer.cmake.in#L304-L306)

It was a regression introduced in [https://github.com/Slicer/Slicer/commit/e93ec804c80a532a8d59a4c945ab4b81ff9a888f](https://github.com/Slicer/Slicer/commit/e93ec804c80a532a8d59a4c945ab4b81ff9a888f)

I will follow up with the best course of action
