SENSEI-insitu / SENSEI

SENSEI ∙ Scalable in situ analysis and visualization

Home Page:https://sensei-insitu.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Policy deprecation warning with CMake 3.20.5

c-wetterer-nelson opened this issue · comments

cmake_policy(SET CMP0074 OLD)

This policy is on the chopping block in CMake and might get removed from underneath us. Configuring SENSEI with CMake 3.20.5 provides this warning:

CMake Deprecation Warning at CMakeLists.txt:3 (cmake_policy):
  The OLD behavior for policy CMP0074 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

Here is what CMake provides on this policy:

CMP0074
-------

``find_package()`` uses ``<PackageName>_ROOT`` variables.

In CMake 3.12 and above the ``find_package(<PackageName>)`` command now
searches prefixes specified by the ``<PackageName>_ROOT`` CMake
variable and the ``<PackageName>_ROOT`` environment variable.
Package roots are maintained as a stack so nested calls to all ``find_*``
commands inside find modules and config packages also search the roots as
prefixes.  This policy provides compatibility with projects that have not been
updated to avoid using ``<PackageName>_ROOT`` variables for other purposes.

The ``OLD`` behavior for this policy is to ignore ``<PackageName>_ROOT``
variables.  The ``NEW`` behavior for this policy is to use
``<PackageName>_ROOT`` variables.

This policy was introduced in CMake version 3.12.  CMake version
3.20.5 warns when the policy is not set and uses ``OLD`` behavior.
Use the ``cmake_policy()`` command to set it to ``OLD`` or ``NEW``
explicitly.

.. note::
  The ``OLD`` behavior of a policy is
  ``deprecated by definition``
  and may be removed in a future version of CMake.

@c-wetterer-nelson I guess at some point we had to add that policy to silence a CMake warning. I also suspect that switching to the new policy is not an issue, although I'm not 100% sure I think I set the OLD behavior only because it seemed to be the path of least resistance at the time. If things compile on Ubuntu 18.04's version of CMake with the new policy we can call it good. Do you want to tackle this issue? If so please have at it!

I just deleted that block and it configured/compiled just fine on ubuntu 18.04! (modulo some deprecation warnings in vtkHistogram... I'll make an issue for that).

Maybe we should bump CMake's minimum version to 3.12 to cover our bases? I don't have legacy CMake laying around to test against at the moment.

I am using cmake 3.22 and do not see this, so it must have been fixed. for future reference our policy is to support the cmake that ships with the oldest active ubuntu lts release. at the moment I believe that is 20.04