Build extension that depends on other extensions

While the build documentation of Slicer is complete, I found it hard to build an extension that depends on other extensions and I had to come up on how to do it myself. So here is my code for that:

I still don’t know to use the alternative SuperBuild method to do this but I’d like to learn about it because I think it should be simpler

This won’t solve your problem.

Slicer’s CMakeLists.txt has these lines:

# Directories can be set in three ways:
#
# (1) Automatically by specifying the label 'REMOTE_MODULE' when
#     calling 'Slicer_Remote_Add' from SuperBuild.cmake.
#
# (2) Automatically by specifying the label 'REMOTE_EXTENSION' when
#     calling 'Slicer_Remote_Add' from SuperBuild.cmake.
#
# (3) Explicitly by configuring the project using the following syntax:
#  cmake -DSlicer_EXTENSION_SOURCE_DIRS:STRING=/path/to/ExtensionA;/path/to/ExtensionB /path/to/source/Slicer

I understand that #3 is what you would need. It could be as simple as adding the Slicer_EXTENSION_SOURCE_DIRS variable to your command line that configures Slicer. But the " /path/to/source/Slicer" part is confusing. It’s doubtful that it refers to an executable, and it’s not in the form of a ‘-D’ cmake parameter.

Never tried that, just discovered that Slicer can build extensions and modules while being built itself.

Your method is mine also: build everything separately.

Shame on me, it’s just the path to Slicer sources :thinking: :crazy_face:

1 Like