Opened 6 years ago

Last modified 13 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: cooljeanius (Eric Gallager)
Port: cmake


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


  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) 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by RJVB (René Bertin)

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

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

comment:2 Changed 2 years ago by michaelld (Michael Dickens)

Is this still an issue for CMake 3.18.0?

comment:3 Changed 2 years ago by RJVB (René Bertin)

What I just replied on #53201

comment:4 in reply to:  3 Changed 13 months ago by cooljeanius (Eric Gallager)

Replying to RJVB:

What I just replied on #53201

Could the two issues be merged, or is there some sort of difference between them? They seem pretty similar to me...

comment:5 Changed 13 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

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

Yes, it seems they could (into this one as it appears to be the more generic of the two).

Note: See TracTickets for help on using tickets.