[MacPorts] #53201: cmake, "compile features" and macports-clang

MacPorts noreply at macports.org
Tue Jan 3 20:06:42 UTC 2017


#53201: cmake, "compile features" and macports-clang
---------------------+-----------------
  Reporter:  RJVB    |      Owner:
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  cmake   |
---------------------+-----------------

Comment (by RJVB):

 I was a bit too enthusiastic: setting CMP0025 on the commandline can still
 be undone by a `cmake_minimum_required(VERSION x)` with `x < 3.0` in the
 CMakeLists.txt file. It turns out it is NOT possible to set the minimum
 required version on the commandline.

 Annoyingly, this can lead to an impressive series of errors that aren't
 very helpful though I guess that after a while you understand what they
 imply.

 I can think of only 1 way to prevent this:

 - create a cache file (akin to QMake's .qmake.cache), say
 `${workpath}/.cmake.initcache` that contains
 `cmake_minimum_required(VERSION 3.0)`
 - tell CMake to load that file with `-C${workpath}/.cmake.initcache`

 (I'm using ${workpath} because no sane project should be writing anything
 there, whereas we cannot be sure about ${build.dir} and ${worksrcpath}).

 This file can be written in the pre-configure, or when the default
 `configure.pre_args` value is fixed.

 Thoughts - @michaelld, @larryv?

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


More information about the macports-tickets mailing list