[MacPorts] #62698: restrictive patch to CMake's find frameworks algorithm

MacPorts noreply at macports.org
Wed Apr 14 22:04:02 UTC 2021


#62698: restrictive patch to CMake's find frameworks algorithm
---------------------+-----------------------
  Reporter:  RJVB    |      Owner:  michaelld
      Type:  defect  |     Status:  assigned
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  cmake   |
---------------------+-----------------------

Comment (by RJVB):

 Replying to [comment:3 michaelld]:

 > 1) We (or at least I) want the defaults for CMake as supplied by MP to
 search through MP paths first, then system paths.

 Then you would probably want to remove all but /System/Library/Frameworks
 (and its /Network equivalent if that exists)!

 > 3) The developer using MP CMake can always specify paths for CMake to
 search that are outside of any from (1). I'm pretty sure with modern CMake
 these paths can search first or last. Thus with the equivalent of a "CMake
 portgroup" one can batch-configure projects to all point to the same
 search directories. Not perfect, but it would work.

 I understand the reasons behind this, but it's still crippling the tool, a
 bit like if you disallowed an IDE installed through MacPorts from
 accessing SDKs or toolchains installed independently. A better analogy
 might be $PATH; imagine if MacPorts would make it hard for you to have
 /usr/local/bin in your path. The `port` driver command *could* do that in
 theory; instead, "base" just sets its own PATH.

 It would be perfectly possible (and rather trivial) to patch
 `CMakeFindFrameworks.cmake` in such a way that the CMake PortGroup(s) can
 require a sanitised framework search path. That would be a more correct
 solution: users would benefit from the extended framework search path that
 includes $prefix/Frameworks, while port builds are restriced to the "legal
 minimum" by default.

 I've extended CMake functionality before so if there's interest for such a
 patch it shouldn't take me too long to write and test it.

-- 
Ticket URL: <https://trac.macports.org/ticket/62698#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list