draco icon indicating copy to clipboard operation
draco copied to clipboard

Error building using cmake >= 3.27.1

Open DKatz96 opened this issue 2 years ago • 1 comments

I was trying to build from source for the jetson xavier dev kit (arm64) and was unable to build using cmake 3.27.1.

The following warning appeared:

CMake Warning (dev) at CMakeLists.txt:39 (include):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake provides the following information regarding this issue:

cmake --help-policy CMP0148
CMP0148
-------

.. versionadded:: 3.27

The ``FindPythonInterp`` and ``FindPythonLibs`` modules are removed.

These modules have been deprecated since CMake 3.12.
CMake 3.27 and above prefer to not provide the modules.
This policy provides compatibility for projects that have not been
ported away from them.

Projects using the ``FindPythonInterp`` and/or ``FindPythonLibs``
modules should be updated to use one of their replacements:

* ``FindPython3``
* ``FindPython2``
* ``FindPython``

The ``OLD`` behavior of this policy is for ``find_package(PythonInterp)``
and ``find_package(PythonLibs)`` to load the deprecated modules.  The ``NEW``
behavior is for uses of the modules to fail as if they do not exist.

This policy was introduced in CMake version 3.27.  CMake version
3.27.1 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.

Replacing include(FindPythonInterp) with include(FindPython3) in CMakeLists.txt as recommended fixes the issue. Maybe this can be updated for future releases?

DKatz96 avatar Aug 08 '23 09:08 DKatz96

Just to clarify: your issue title says "Error building" but you haven't described an error; you've described a warning. This warning doesn't prevent the software from building, right?

ryandesign avatar Apr 13 '24 09:04 ryandesign