pqCore cyclic dependency in a module

Hello,

I wrote a plugin that interacts with pipeline items. I need to access the server manager to gather the information that I want, hence a couple calls to pqApplicationCore::instance()->getServerManagerModel() and the findItem methods.

It works fine as a standalone plugin.
However, I’d like to build it within a module. Here is my module.cmake

vtk_module(myModule
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkIOXML
vtkPVServerManagerCore
pqCore
)

option(Module_myModule “My Module” ON)

My CMakeLists.txt

set(Module_SRCS
myPlugin.cxx
)

vtk_module_library(myModule
${Module_SRCS}
)

And this is where the fun begins. This is my CMake output:

CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
“vtkPVServerManagerApplication” of type SHARED_LIBRARY
depends on “myModuleCS” (weak)
depends on “myModule” (weak)
depends on “pqCore” (weak)
“pqCore” of type SHARED_LIBRARY
depends on “vtkPVServerManagerApplication” (weak)
“myModule” of type SHARED_LIBRARY
depends on “pqCore” (weak)
“myModuleCS” of type STATIC_LIBRARY
depends on “myModule” (weak)
depends on “pqCore” (weak)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.

I tried fiddling with the module.cmake, the CMakeLists.txt and the plugin.cmake but I can never get it to work.

Without pqCore in the DEPENDS, the CMake generation completes but my compiler doesn’t find the headers.
I noticed that if I add the EXCLUDE_FROM_WRAPPING tag, it seems to compile fine but ParaView won’t load it
(vtkPVPluginLoader (000001DF03B18670): Not a ParaView Plugin since could not locate the plugin-verification function)

Any clues?
Thanks

Did you try to use PRIVATE_DEPENDS instead of DEPENDS for modules that are required only in the implementation?

Hi Mathieu,

Yes, I tried that as well but the result is similar.

vtk_module(myModule
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkIOXML
vtkPVServerManagerCore
PRIVATE_DEPENDS
pqCore
)

option(Module_myModule “My Module” ON)

CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
“vtkPVServerManagerApplication” of type SHARED_LIBRARY
depends on “myModuleCS” (weak)
depends on “myModule” (weak)
“pqCore” of type SHARED_LIBRARY
depends on “vtkPVServerManagerApplication” (weak)
“myModule” of type SHARED_LIBRARY
depends on “pqCore” (weak)
“myModuleCS” of type STATIC_LIBRARY
depends on “myModule” (weak)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.