Solution:
Slicer nightly tests just needs to have those additional dependencies loaded for running tests. Otherwise this doesn’t mirror the real world where I need to install an extension from the ExtensionManager where the downloaded extensions (dependencies) automatically get added to the Slicer “Additional module paths”. And after restarting the extension (optimally) works like a charm!
Hope we can find a simple and quick solution for that.
SlicerDevelopmentToolbox is definitely missing. When building an extension, would this file automatically get extended by the missing dependencies? That’s what I would expect.
The AdditionalLauncherSettings.ini of my local mpReview build looks like the following:
Oh yeah. When building an extension which depends on other extensions I would assume the AdditionalLauncherSettings.ini to be extended by the dependencies, which probably would fix that issue.
In my case the extension GelDosimetryAnalysis depends on SlicerRT. The problem locally is that the SlicerRT_DIR CMake variable is not set. Instead it gives me this
CMake warning message
CMake Warning at C:/d/Slicer4/Extensions/CMake/SlicerBlockAdditionalLauncherSettings.cmake:48 (MESSAGE):
Dependent extension SlicerRT cannot be found by CMake find_package(),
therefore paths variables cannot be imported from this extension. The
problem can be resolved by generating SlicerRTConfig.cmake by adding
include(${Slicer_EXTENSION_GENERATE_CONFIG}) to the top-level
CMakeLists.txt of the dependent exension.
Call Stack (most recent call first):
C:/d/S4R/Slicer-build/UseSlicer.cmake:281 (include)
CMakeLists.txt:24 (include)
However include(${Slicer_EXTENSION_GENERATE_CONFIG}) is in the top-level CMakeLists, and SlicerRT does generate a SlicerRTConfig.cmake.
If I define SlicerRT_DIR manually, then it works nicely. It’s not done on the factory unfortunately, and this is where I am stuck now. We have a factory machine and was going to take a look at the issue on it, but I haven’t gotten to that point yet.
Right. The template mentions the space separation, so that was fine. However the example “NA” is within quotes, and that made me put them between quotes. Maybe if we remove the quotes from the template or explain this in the same comment, then it’s less error-prone.
Additional directories are collected recursively from all extensions that your extension depends on, and added to the additional launcher settings. Does it work until this point?
Adding of _DIR for all required extensions is implemented in SlicerBlockBuildPackageAndUploadExtensions.cmake:
Maybe you could add a couple of MESSAGE prints in this file to see where things go wrong. If everything looks fine then you can go one step further and check if the generated CMake cache file content is correct (contains _DIR and the value is correct). If not, you can add some MESSAGE prints here: