Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\lloyd\Downloads\WindowsWheel3.9.venv\lib\site-packages\itk\support\lazy.py”, line 132, in getattribute
base.itk_load_swig_module(module, namespace)
File “C:\Users\lloyd\Downloads\WindowsWheel3.9.venv\lib\site-packages\itk\support\base.py”, line 102, in itk_load_swig_module
itk_load_swig_module(dep, namespace)
File “C:\Users\lloyd\Downloads\WindowsWheel3.9.venv\lib\site-packages\itk\support\base.py”, line 98, in itk_load_swig_module
l_data = itk_base_global_module_data[name]
KeyError: ‘ITKImageSources’
A way to check correctness of these dependencies is to build ITK with ITK_BUILD_DEFAULT_MODULES=OFF and ITKGroup_Core=OFF. Then only the declared dependencies will be built.
Edit: you will need to set Module_ITKCommon=ON and maybe Module_ITKImageSources=ON.
Depends requires the modules for use, e.g. by publicly including it in header files. Compile depends indicates it is only required for compiling the module but not for using it. That makes sense only for modules which have a compiled part, i.e. modules which are not header-only.
Example where compile depends would make sense: module A is header-only, and module B’s compile part uses module A but does not expose it in its public interface. If module A had a compile part too, regular depends would be required because or requiring A’s DLL at runtime.
Was that with static or shared libraries? If you are using ITKCommon, there is a “runtime” library dependency that is needed. Depending on the OS/compiler used the order of linking of libraries can matter. Based on @dzenanz explanation this is not a COMPILE_DEPENDS situation, so there will likely be some problems with certain configurations and systems.
@dyoll I don’t think you need set(TopologyControl_LIBRARIES ITKCommon), as your module is header-only and you are not using any external libraries. Having ITKCommon in your module’s DEPENDS section implies linking to it.