# Failures due to build order of Slicer CAT with superbuild remote modules

**URL:** <https://discourse.slicer.org/t/failures-due-to-build-order-of-slicer-cat-with-superbuild-remote-modules/21841>\
**Category:** Support\
**Created:** [February 7, 2022, 4:14pm UTC](https://discourse.slicer.org/t/failures-due-to-build-order-of-slicer-cat-with-superbuild-remote-modules/21841 "2022-02-07T16:14:23Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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:** [February 8, 2022, 10:03pm UTC](https://discourse.slicer.org/t/failures-due-to-build-order-of-slicer-cat-with-superbuild-remote-modules/21841/11 "2022-02-08T22:03:06Z")

</div>

### SlicerJupyter use-case custom application bundling use-case

> [@lassoan](#):
>
> If there is a project has dependencies that are provided in the Slicer core (ITK, VTK, DCMTK, etc.) then we need to add them using `ExternalProject_Add_Dependencies(${proj} DEPENDS ...)` ; and add other libraries (zmq, pybind11, xeus, etc.) using `SET(${proj}_DEPENDS ...)` ?

There is no need to specify additional `set(${proj}_DEPENDS ..)`

To make things concrete, bundling `SlicerJupyter` would only require the following in the custom application top-level `CMakeLists.txt`:

```cmake
# SlicerJupyter
set(extension_name "SlicerJupyter")
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/Slicer/SlicerJupyter.git
  GIT_TAG b282a2c819da1e3e4fe1ab6c419e2299f976720d
  GIT_PROGRESS 1
  QUIET
  )
list(APPEND Slicer_EXTENSION_SOURCE_DIRS ${${extension_name}_SOURCE_DIR})

ExternalProject_Add_Dependencies(pybind11
  DEPENDS
    python
  )

ExternalProject_Add_Dependencies(python-packages
  DEPENDS
    python
    python-pip
    python-setuptools
  )

```

The configuration output effectively indicates the dependencies are considered:

```bash
$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DQt5_DIR:PATH=$Qt5_DIR ../SlicerGalaxy
[...]
-- SuperBuild - python-packages => Requires python[INCLUDED], python-pip[INCLUDED], python-setuptools[INCLUDED], 
-- SuperBuild - python-packages[OK]
[...]
-- SuperBuild - pybind11 => Requires python[INCLUDED], 
-- SuperBuild - pybind11[OK]
[...]

```

#### Suggested SlicerJupyter updates

- There are some hard-coded instance of the string `lib/python3.6/site-packages` that should be removed. Instead the variable `PYTHON_SITE_PACKAGES_SUBDIR`should be used. This pull request should take care of this: [COMP: Fix python-packages external project removing hard-coded site-packages path by jcfr · Pull Request #67 · Slicer/SlicerJupyter · GitHub](https://github.com/Slicer/SlicerJupyter/pull/67)

- Considering `python-packages` project name is fairly generic and could conflict with other extension install python packages, we should rename it to `python-slicerjupyter-requirements`. This will be done after the previous pull-request has been integrated. It is tracked by this issue: [GitHub · Where software is built](https://github.com/Slicer/SlicerJupyter/issues/68)

- To provide some more flexibility, we should also look into adding  
`Slicer_REQUIRED_PYTHON_VERSION_DOT` recently introduced in [Slicer@e32fa814f](https://github.com/Slicer/Slicer/commit/e32fa814fecdc73cf817141ce0d36d0a088e3881) to `SlicerConfig.cmake.in`. This pull request takes care of this: [COMP: Add Slicer\_REQUIRED\_PYTHON\_VERSION\_\* variables to SlicerConfig by jcfr · Pull Request #6169 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/pull/6169)

---

_[View the full topic](https://discourse.slicer.org/t/failures-due-to-build-order-of-slicer-cat-with-superbuild-remote-modules/21841)._
