# CMake Paraview Config Fail for not found FiltersParallelDIY2 in my plugin project since 5.9

**URL:** https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860
**Category:** Development
**Created:** [August 24, 2021, 9:09am UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860 "2021-08-24T09:09:56Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 24, 2021, 9:09am UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/1 "2021-08-24T09:09:56Z")

</div>

I build ParaView 5.9.1 from source and need to compile plugin project in my PC.  
cmake configuration of plugin project give me the error message:

**The following imported targets are referenced, but are missing:**  
**VTK::FiltersParallelDIY2**

**Here is details:**

My ParaView build installed to path:  
**D:/ParaView59** ,

here is dir tree structure and paraview-config.cmake:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/7/722c774627e86404a94ac61b78b4d742be1ec131.png)

and following is my top level CMakeLists.txt to find paraview in my plugin project:

```auto
42: set(ParaView_DIR "D:/ParaView59/lib/cmake/paraview-5.9")
43: find_package(ParaView REQUIRED)

```

CMake configure fail and give me this message:

> CMake Error at CMakeLists.txt:43 (find\_package):  
> Found package configuration file:
> 
> ```
> D:/ParaView59/lib/cmake/paraview-5.9/paraview-config.cmake
> 
> ```
> 
> but it set ParaView\_FOUND to FALSE so package “ParaView” is considered to  
> be NOT FOUND. Reason given by package:
> 
> The following imported targets are referenced, but are missing:  
> VTK::FiltersParallelDIY2

I have manully checked my install directory, all files relative to FiltersParallelDIY2 in my ParaView install dir and is path is here:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/d78e95ee9e9be6ab03bf1517fe00ebfbe30607b3.png)

**Additional infomations:**  
I built ParaView 5.9 offcial released source code with Visual Studio 15 2017 Win64, and plugin project config is same.  
Python version is 3.7.5  
I have used these project in both ParaView5.7 and ParaView5.8, and have never faced this issue.

**So, maybe I missed some new cmake request in new version? or is there any clue to debug this?**  
**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: [August 24, 2021, 9:11am UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/2 "2021-08-24T09:11:42Z")

</div>

Can you try with ninja instead of visual studio ?  
Can you try with MPI disabled ?

---

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 24, 2021, 9:21am UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/4 "2021-08-24T09:21:53Z")

</div>

MPI is already disabled in my ParaView build.

The plugin project has tons of dependency libraries built with visual studio,  
I am afread there are too many works to do compiling all these libs with ninja.

So why paraview config scripts cannot find existing FiltersParallelDIY2 lib in my ParaView\_DIR? bug in Visual Studio Compiler ?

---

<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: [August 24, 2021, 9:24am UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/5 "2021-08-24T09:24:41Z")

</div>

FYI @ben.boeckel

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [August 24, 2021, 12:07pm UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/6 "2021-08-24T12:07:49Z")

</div>

Since we find VTK without components, everything from VTK should be available. Can you see if there is a `VTK::FiltersParallelDIY2` target in `lib/cmake/paraview-5.9/vtk/vtk-targets.cmake`?

---

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 24, 2021, 3:53pm UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/7 "2021-08-24T15:53:00Z")

</div>

@ben.boeckel  
Yes, there is an imported target:

```auto
# Create imported target VTK::FiltersParallelDIY2
add_library(VTK::FiltersParallelDIY2 SHARED IMPORTED)

set_target_properties(VTK::FiltersParallelDIY2 PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/paraview-5.9"
  INTERFACE_LINK_LIBRARIES "VTK::FiltersCore;VTK::FiltersParallel;VTK::ParallelDIY"
)

```

I also found some message in cmake-trace-expand may help:

> D:/ParaView59/lib/cmake/paraview-5.9/HyperTreeGridADR-targets.cmake(104): if(CMAKE\_FIND\_PACKAGE\_NAME )  
> D:/ParaView59/lib/cmake/paraview-5.9/HyperTreeGridADR-targets.cmake(105): set(ParaView\_FOUND FALSE )  
> D:/ParaView59/lib/cmake/paraview-5.9/HyperTreeGridADR-targets.cmake(106): set(ParaView\_NOT\_FOUND\_MESSAGE The following imported targets are referenced, but are missing: VTK::FiltersParallelDIY2 )

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [August 24, 2021, 5:21pm UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/8 "2021-08-24T17:21:43Z")

</div>

Hmm. Interesting. That `HyperTreeGridADR` file should be being included after the `find_package(VTK)`. Are there other hints as to why the target isn’t available at that point from the expanded trace?

---

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 25, 2021, 8:24am UTC](https://discourse.paraview.org/t/cmake-paraview-config-fail-for-not-found-filtersparalleldiy2-in-my-plugin-project-since-5-9/7860/9 "2021-08-25T08:24:23Z")

</div>

I found the reason by exploring cmake trace. Its my fault.

```auto
find_package(VTK REQUIRED
  ${_paraview_find_package_args})
if (NOT VTK_FOUND)
  set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 0)
endif ()

```

I have set a environment variable VTK\_DIR points to paraview5.7, this cause vtk finder get the wrong position although the variable

> ${\_paraview\_find\_package\_args}

give PATHS parameter points to the correct vtk path.
