# ParaView compilation and CMake versions

**URL:** https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513
**Category:** Development
**Created:** [April 29, 2024, 10:01am UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513 "2024-04-29T10:01:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [April 29, 2024, 10:01am UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513/1 "2024-04-29T10:01:31Z")

</div>

Compiling my current ParaView custom application with PV 5.12.0 ends up with tons of warning messages about _Policy CMP0116 is not set_. I can see what this policy is about - and now I should know what the ParaView build actually expects in it’s `add_custom_command()` CMake function call!?

I have now 3 options: set this policy in my own CMakeLists.txt to either “OLD” or “NEW”, or tell CMake to ignore warnings:

- I guess that with “OLD” I do nothing wrong, because I assume that CMake version \<=3.19 is ok for the build, but I may run into problems if the “old” behaviour would be eventually removed

- I can go for “NEW”, but I would not have any idea whether this would cause trouble somewhere down the line - certainly in the most unexpected situation where I would never ever have a chance to trace some misbehaviour back to that option

- I can simply suppress warning messages. This would end up with “OLD”, and at the same time I would also miss tons of other possibly useful messages

Any pragmatic recommendation?

PS: I just see that after adding to my main CMakeLists.txt the following line:

> cmake\_policy(SET CMP0116 OLD)

I still get the exactly same warnings! Even if I add that line to all my CMakeLists.txt files. So the additional question would be where to define this policy in such a way that it has any effect at all!? The warnings are all coming from the `vtk_module_add_module()` calls that I use to add all my new modules.

---

<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: [April 29, 2024, 10:03am UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513/2 "2024-04-29T10:03:16Z")

</div>

Can you share the code generating these warnings ?

---

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [April 29, 2024, 10:15am UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513/3 "2024-04-29T10:15:04Z")

</div>

All my modules I am adding with a little `CMakeLists.txt` like this one:

```auto
set(classes
  utilDebugLog)

set(headers
  utilTrackDefs.h)

vtk_module_add_module(AthosGeoView::AtgDebugLog
  CLASSES
    ${classes}
  HEADERS
    ${headers})

# the only purpose of this is to bring the vtk.module file into QtCreator
add_custom_target(AtgDebugLog_module_spec
  SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/vtk.module)

```

This is then the warning message that comes from each one of these “module generator” files:

```auto
CMake Warning (dev) at /home/cornelis/Main/develop/ParaView/Binaries/ParaView-v5.12.0/Release/lib/cmake/paraview-5.12/vtk/vtkModule.cmake:3663 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command(). Run "cmake --help-policy CMP0116" for policy
  details. Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/cornelis/Main/develop/ParaView/Binaries/ParaView-v5.12.0/Release/lib/cmake/paraview-5.12/vtk/vtkModule.cmake:4209 (_vtk_module_write_wrap_hierarchy)
  Core/AtgDebugLog/CMakeLists.txt:7 (vtk_module_add_module)
This warning is for project developers. Use -Wno-dev to suppress it.

```

---

<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: [April 29, 2024, 10:16am UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513/4 "2024-04-29T10:16:29Z")

</div>

Could you use  
```  
```

instead of \>

For formatting

---

<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: [April 29, 2024, 8:32pm UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513/5 "2024-04-29T20:32:44Z")

</div>

This was fixed recently. I don’t remember if 5.12.1 will have it, but 5.13 will.

---

<div class="post-metadata">

### Author: ![cobo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/f17d59/32.png) [@cobo](https://discourse.paraview.org/u/cobo)
#### Post date: [April 29, 2024, 9:33pm UTC](https://discourse.paraview.org/t/paraview-compilation-and-cmake-versions/14513/6 "2024-04-29T21:33:43Z")

</div>

Thanks!

Conclusion from my side: Just ignore the warnings for now, and once I migrate to a new version, chances are that they will simply disappear without further changes in my code: Good news thus!
