# pqCore cyclic dependency in a module

**URL:** https://discourse.paraview.org/t/pqcore-cyclic-dependency-in-a-module/1333
**Category:** Development
**Created:** [February 21, 2019, 5:04pm UTC](https://discourse.paraview.org/t/pqcore-cyclic-dependency-in-a-module/1333 "2019-02-21T17:04:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![phil\_ossk](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/858c86/32.png) [@phil\_ossk](https://discourse.paraview.org/u/phil_ossk)
#### Post date: [February 21, 2019, 5:04pm UTC](https://discourse.paraview.org/t/pqcore-cyclic-dependency-in-a-module/1333/1 "2019-02-21T17:04:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 21, 2019, 5:15pm UTC](https://discourse.paraview.org/t/pqcore-cyclic-dependency-in-a-module/1333/2 "2019-02-21T17:15:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![phil\_ossk](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/858c86/32.png) [@phil\_ossk](https://discourse.paraview.org/u/phil_ossk)
#### Post date: [February 21, 2019, 6:29pm UTC](https://discourse.paraview.org/t/pqcore-cyclic-dependency-in-a-module/1333/3 "2019-02-21T18:29:10Z")

</div>

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.
