# Build Slicer with IGT

**URL:** <https://discourse.slicer.org/t/build-slicer-with-igt/33037>\
**Category:** Development\
**Created:** [November 26, 2023, 3:54pm UTC](https://discourse.slicer.org/t/build-slicer-with-igt/33037 "2023-11-26T15:54:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![1116](https://avatars.discourse-cdn.com/v4/letter/1/439d5e/32.png) [@1116](https://discourse.slicer.org/u/1116)\
**Post date:** [November 26, 2023, 3:54pm UTC](https://discourse.slicer.org/t/build-slicer-with-igt/33037/1 "2023-11-26T15:54:02Z")

</div>

I am building Slicer with SlicerIGT.  
I want the IGT module to be automatically added in Slicer when the Slicer.exe is created.

Where should I put the following commands in the top CMakeLists.txt of the Slicer code? Is it OK to put the commands at the end?

```auto
#-----------------------------------------------------------------------------
# SlicerIGT
set(extension_name "SlicerIGT")
set(${extension_name}_SOURCE_DIR "${CMAKE_BINARY_DIR}/${extension_name}")
FetchContent_Populate(${extension_name}
  SOURCE_DIR ${${extension_name}_SOURCE_DIR}
  GIT_REPOSITORY ${EP_GIT_PROTOCOL}://github.com/slicerigt/slicerigt.git
  GIT_TAG master
  GIT_PROGRESS 1
  QUIET
  )
list(APPEND Slicer_EXTENSION_SOURCE_DIRS ${${extension_name}_SOURCE_DIR})

```

Further, is there any example of using Slicer\_EXTENSION\_SOURCE\_DIRS in cmakelist.txt instead of using the above commands?

Thank you
