cmake-basis / legacy

Legacy CMake BASIS project for versions 3.2 and older. For newer versions, go to
https://github.com/cmake-basis/BASIS
Other
13 stars 11 forks source link

deal with new CMP0064 #500

Closed ahundt closed 8 years ago

ahundt commented 8 years ago

I think basis will conflict with the new cmake policy for TEST in 3.4.1:

± cmake  --help-policy CMP0064
CMP0064
-------

Recognize ``TEST`` as a operator for the ``if()`` command.

The ``TEST`` operator was added to the ``if()`` command to determine if a
given test name was created by the ``add_test()`` command.

The ``OLD`` behavior for this policy is to ignore the ``TEST`` operator.
The ``NEW`` behavior is to interpret the ``TEST`` operator.

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

For example:

-- Adding executable SlidingWindowBA_test...
CMake Warning (dev) at /usr/local/share/cmake-modules/TargetTools.cmake:1724 (if):
  Policy CMP0064 is not set: Support new TEST if() operator.  Run "cmake
  --help-policy CMP0064" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  TEST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /usr/local/share/cmake-modules/TargetTools.cmake:754 (basis_add_executable_target)
  thirdparty/camodocal/cmake/BinaryUtilities.cmake:69 (basis_add_executable)
  thirdparty/camodocal/cmake/BinaryUtilities.cmake:93 (_camodocal_test_intern)
  thirdparty/camodocal/src/visual_odometry/CMakeLists.txt:32 (camodocal_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/share/cmake-modules/ExportTools.cmake:47 (if):
  Policy CMP0064 is not set: Support new TEST if() operator.  Run "cmake
  --help-policy CMP0064" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  TEST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /usr/local/share/cmake-modules/TargetTools.cmake:1746 (basis_add_export_target)
  /usr/local/share/cmake-modules/TargetTools.cmake:754 (basis_add_executable_target)
  thirdparty/camodocal/cmake/BinaryUtilities.cmake:69 (basis_add_executable)
  thirdparty/camodocal/cmake/BinaryUtilities.cmake:93 (_camodocal_test_intern)
  thirdparty/camodocal/src/visual_odometry/CMakeLists.txt:32 (camodocal_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/share/cmake-modules/TargetTools.cmake:1750 (if):
  Policy CMP0064 is not set: Support new TEST if() operator.  Run "cmake
  --help-policy CMP0064" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  TEST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /usr/local/share/cmake-modules/TargetTools.cmake:754 (basis_add_executable_target)
  thirdparty/camodocal/cmake/BinaryUtilities.cmake:69 (basis_add_executable)
  thirdparty/camodocal/cmake/BinaryUtilities.cmake:93 (_camodocal_test_intern)
  thirdparty/camodocal/src/visual_odometry/CMakeLists.txt:32 (camodocal_test)
This warning is for project developers.  Use -Wno-dev to suppress it.
schuhschuh commented 8 years ago

If I recall correctly, I've fixed this in the last release.

schuhschuh commented 8 years ago

See #490 (commit 3c5c5b5c126033550409df38bd8b7d3ff910ff36).

ahundt commented 8 years ago

strange, I have 3.2, I wonder why I'm getting these warnings...

schuhschuh commented 8 years ago

Have you checked one of the offending lines? E.g., /usr/local/share/cmake-modules/TargetTools.cmake:1750, can you paste it here? Just to make sure you use indeed the latest version.

ahundt commented 8 years ago

you are right, reinstalling changed that line. Sorry about that! don't know how it got out of date.