Loadable custom markups : how to install the packaged extension

I’m in the very early stages trying to create a loadable custom markups in C++, using extension wizard’s template. I can build the extension and module outside Slicer’s build tree, and create an extension package.

  1. When the lib directory of this package is simply copied to Slicer’s lib directory, I can make the custom markups appear in th eMarkups module and use it with this code in Python console :
d = slicer.vtkMRMLMarkupsCustomNode()
w = slicer.vtkSlicerCustomWidget()
l=slicer.modules.markups.logic()
l.RegisterMarkupsNode(d, w)
  1. If I install the extension with the Extension Manager pointing to the local file, it gets rightly unpacked in NA-MIC/Extensions-30783/. However, on restart, the custom markups button is not available in the Markups module. And the above code fails, vtkMRMLMarkupsCustomNode is not found.

I expected, perhaps wrongly, that #2 would make the custom markups available transparently. How can we reach a nice development workflow in this context ?

Thank you.

Ok, I could solve it by starting Slicer with –additional-module-paths pointing to the lib directory of the module build tree. The ‘Testing’ checking should also be removed in qSlicerCustomModule::setup() and qSlicerCustomModule::createLogic().

By the way, what’s this qSlicerCoreApplication::AA_EnableTesting flag ? Greping Slicer source and Slicer-build/*, it appears only in compiled binaries and the qSlicerTemplateKeyModule.cxx files.