Opened 4 years ago

Last modified 6 months ago

#53615 assigned defect

cmake : ignore policy CMP0025

Reported by: RJVB (René Bertin) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc:
Port: cmake

Description

CMake has a policy (number 25) under which it considers that only Apple's clang can provide information on the features it supports. Depending on how the CMake file is configured this can lead to the following vague error (printed *after* the whole configure process has been completed), when using a clang version from MacPorts:

-- Configuring done
CMake Error in CMakeLists.txt:
  No known features for CXX compiler

  "Clang"

  version 3.9.0.

There are ways around this by patching the CMake file, and I have seen some limited success in adding a default cmake argument (-DCMAKE_POLICY_DEFAULT_CMP0025=NEW) but ultimately this depends on a few rather silly checks that IMHO could just as well be disabled at the source. The attached patch does that.

NB: the CMake files affected by this aren't erroneous, in my opinion CMake is wrong in handling AppleClang differently

Attachments (1)

patch-Modules-IgnorePolicy25.diff (801 bytes) - added by RJVB (René Bertin) 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by RJVB (René Bertin)

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: michaelld removed
Owner: set to michaelld
Status: newassigned

comment:2 Changed 6 months ago by michaelld (Michael Dickens)

Is this still an issue for CMake 3.18.0?

comment:3 Changed 6 months ago by RJVB (René Bertin)

What I just replied on #53201

Note: See TracTickets for help on using tickets.