# Proper use of SlicerApp\_APPLICATION\_NAME

**URL:** <https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475>\
**Category:** Development\
**Tags:** build\
**Created:** [July 9, 2019, 2:42am UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475 "2019-07-09T02:42:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattTroke](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MattTroke](https://discourse.slicer.org/u/MattTroke)\
**Post date:** [July 9, 2019, 2:42am UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/1 "2019-07-09T02:42:16Z")

</div>

I have a custom build of Slicer and I am trying to override the application name by setting SlicerApp\_APPLICATION\_NAME. However, I get a pile of CMake errors when i build. It seems to fail to find several targets whose names are based on SlicerApp\_APPLICATION\_NAME. The name I set it to is similar to “Slicer (XXX Edition)”. Is there a limitation on what characters may be used in the name? What is the proper method for changing the name of the Slicer app?

---

<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:** [July 9, 2019, 3:03am UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/2 "2019-07-09T03:03:25Z")

</div>

The variable `SlicerApp_APPLICATION_NAME` can not contain special characters. If you would like to set a string like “Slicer (XXX Edition)”, I suggest you set a different window title.

Assuming you use the [KitwareMedical/SlicerCustomAppTemplate](https://github.com/KitwareMedical/SlicerCustomAppTemplate#readme), you could easily customize the value in the Main.cpp associated with the application. See [here](https://github.com/KitwareMedical/SlicerCustomAppTemplate/blob/6ef298c246c110fb2e1f28108c5fc6e7e93d3a2a/%7B%7Bcookiecutter.project_name%7D%7D/Applications/%7B%7Bcookiecutter.app_name%7D%7DApp/Main.cxx#L50)

---

<div class="post-metadata">

**Author:** ![MattTroke](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MattTroke](https://discourse.slicer.org/u/MattTroke)\
**Post date:** [July 9, 2019, 11:32am UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/3 "2019-07-09T11:32:31Z")

</div>

I’m not using the template - can I just set Slicer\_MAIN\_PROJECT\_APPLICATION\_NAME?

---

<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:** [July 9, 2019, 12:18pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/4 "2019-07-09T12:18:37Z")

</div>

I would strongly recommend to use the custom application template as it enables much more refined customization and much cleaner separation of Slicer core and customized code. Also, now all the custom/commercial Slicer editions use the custom application template, so it is very well tested and continuously improved. To avoid redundancy, alternative customization methods (such as changing just the application name) may be deprecated in the future.

---

<div class="post-metadata">

**Author:** ![MattTroke](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MattTroke](https://discourse.slicer.org/u/MattTroke)\
**Post date:** [July 9, 2019, 12:28pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/5 "2019-07-09T12:28:28Z")

</div>

Are there instructions for running the template tool on Windows?

---

<div class="post-metadata">

**Author:** ![MattTroke](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MattTroke](https://discourse.slicer.org/u/MattTroke)\
**Post date:** [July 9, 2019, 12:29pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/6 "2019-07-09T12:29:25Z")

</div>

Also, if I already have a Slicer repository with my custom changes in it, can I still use it, or do I have to start over?

---

<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:** [July 9, 2019, 12:56pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/7 "2019-07-09T12:56:01Z")

</div>

All the instructions for all platforms are described in the git repository of the custom application template. The custom app template allows you to customize Slicer without modifying any Slicer core file, thereby allowing clean separation of all custom changes from Slicer core updates. If you modified Slicer core files then you need to make changes accordingly in the project generated by the template.

---

<div class="post-metadata">

**Author:** ![MattTroke](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@MattTroke](https://discourse.slicer.org/u/MattTroke)\
**Post date:** [July 9, 2019, 1:14pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/8 "2019-07-09T13:14:57Z")

</div>

Is the custom project created by the template based on any particular branch/version of Slicer? Can the branch/repo be specified in the template tool?

---

<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:** [July 9, 2019, 1:38pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/9 "2019-07-09T13:38:56Z")

</div>

By default, the generated project use the [github.com/Slicer/Slicer](http://github.com/Slicer/Slicer) and the latest commit hash. Once the project is generated, you can definitely change the value in the project `CMakeLists.txt`. For example, here is what we do in SlicerSALT:

> <https://github.com/Kitware/SlicerSALT/blob/6617d8e490429057594dbfb3f4864b280ef0096c/CMakeLists.txt#L14-L17>

In this case, we may have some change specific to Slicer fork specific to SlicerSALT. These ones are tracked in [https://github.com/slicersalt/Slicer](https://github.com/slicersalt/Slicer) (see associated README for naming convention of branches in the fork). This is particularly useful waiting improvements to Slicer core are integrated in upstream project.

---

<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:** [July 10, 2019, 12:42pm UTC](https://discourse.slicer.org/t/proper-use-of-slicerapp-application-name/7475/10 "2019-07-10T12:42:00Z")

</div>

2 posts were split to a new topic: [Can you explaing the vaiables Slicer\_MODULES\_DISABLED and Slicer\_MODULES\_ENABLED?](https://discourse.slicer.org/t/can-you-explaing-the-vaiables-slicer-moduletype-modules-disabled-and-slicer-moduletype-modules-enabled/7494)
