# How to build NVIDIA extension using CMake

**URL:** <https://discourse.slicer.org/t/how-to-build-nvidia-extension-using-cmake/19681>\
**Category:** Support\
**Tags:** segmentation, extensions-manager\
**Created:** [September 15, 2021, 8:55am UTC](https://discourse.slicer.org/t/how-to-build-nvidia-extension-using-cmake/19681 "2021-09-15T08:55:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akmal871026](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akmal871026/32/11642_2.png) [@akmal871026](https://discourse.slicer.org/u/akmal871026)\
**Post date:** [September 15, 2021, 8:55am UTC](https://discourse.slicer.org/t/how-to-build-nvidia-extension-using-cmake/19681/1 "2021-09-15T08:55:47Z")

</div>

Hi all, I have followed this instruction to plug in NVIDIA.

But, how to build it in CMake. (attached picture is my C Make)

this step I did not get the last step.

**This one: To build extension package, build 3D Slicer then configure ai-assisted-annotation-client project using CMake, defining these variables: -DSlicer\_DIR:PATH=… -DNvidiaAIAssistedAnnotation\_BUILD\_SLICER\_EXTENSION:BOOL=ON**

## For developers

The plugin can be downloaded and installed directly from GitHub:

- git clone [GitHub - NVIDIA/ai-assisted-annotation-client: Client side integration example source code and libraries for AI-Assisted Annotation SDK](https://github.com/NVIDIA/ai-assisted-annotation-client.git)
- Open 3D Slicer: Go to Edit → Application Settings → Modules → Additional Module Paths
  1. Add New Module Path: \<FULL\_PATH\>/slicer-plugin/NvidiaAIAA
  2. Restart

- To build extension package, build 3D Slicer then configure ai-assisted-annotation-client project using CMake, defining these variables: -DSlicer\_DIR:PATH=… -DNvidiaAIAssistedAnnotation\_BUILD\_SLICER\_EXTENSION:BOOL=ON ![CMake](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/0/509b63267decac58fd1cd1db07abf0397824bd31.jpeg)

---

<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:** [September 15, 2021, 1:40pm UTC](https://discourse.slicer.org/t/how-to-build-nvidia-extension-using-cmake/19681/2 "2021-09-15T13:40:51Z")

</div>

NVIDIA AI-assisted Annotation extension only contains Python-scripted modules, so there is no need to build it. See [Developer guide](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#build-an-extension):

> To build extensions that contain modules implemented in C++, you need to [build Slicer from source](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/index.html) on your machine; they cannot be built against a binary download. If developing modules in Python only, then it is not necessary to build the extension.

You can download and modify the extension and run it as described in the documentation that you quoted above or in the [Developer guide](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html#run-slicer-with-your-custom-modules).

---

<div class="post-metadata">

**Author:** ![akmal871026](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akmal871026/32/11642_2.png) [@akmal871026](https://discourse.slicer.org/u/akmal871026)\
**Post date:** [September 15, 2021, 1:59pm UTC](https://discourse.slicer.org/t/how-to-build-nvidia-extension-using-cmake/19681/3 "2021-09-15T13:59:40Z")

</div>

Yeah, I’ve tried it. But have the got error

---

<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:** [September 15, 2021, 4:56pm UTC](https://discourse.slicer.org/t/how-to-build-nvidia-extension-using-cmake/19681/4 "2021-09-15T16:56:19Z")

</div>

If you need any help resolving the error then tell us what the error is.
