[MacPorts] #52699: cmake portgroup version 1.1
MacPorts
noreply at macports.org
Mon Oct 24 22:48:11 CEST 2016
#52699: cmake portgroup version 1.1
--------------------------+------------------
Reporter: mkae | Owner: mkae
Type: enhancement | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: cmake |
--------------------------+------------------
Comment (by RJVB):
Most of these changes have already been presented elsewhere (and for a
large part, ratified as useful, just never incorporated). I can't find the
tickets with a few quick searches, so here's a bit of background.
First off, I've decided to give my variant a higher version, so both
Michael's original and my more elaborate portgroup can co-exist (for the
time being).
changes include:
- use `CMAKE_BUILD_TYPE=MacPorts`. Inspired by Debian's own build type,
this allows us to specify all compiler settings via the well-known
configure.* commands and exported via the environment. If one of CMake's
predefined types is used the corresponding standard options will be
*appended* to our options, which will override notably the optimisation
options. Some parsing of configure.cppflags, configure.cflags and
configure.cxxflags is done to ensure this works as expected, in lines
145-200 .
- add CMAKE_EXPORT_COMPILE_COMMANDS so that each compiler command is saved
to an additional compile_commands.json file. Completely transparent for
most purposes, but very useful if you want to open the source and existing
build directory in KDevelop (which then won't rerun cmake with default
settings).
- `cmake.install_rpath` : a convenience function to construct
`CMAKE_INSTALL_RPATH` in steps, working around the fact that cmake doesn't
support incremental commandline variables.
- lines 204-243 : ensure there's a compile_commands.json file, and
generate a `.macports.${subport}.configure.cmd` file that summarises the
configure details, as a more permanent reference than the information
available through the logfile. There's been some discussion of adding this
to "base", if that happens this feature will evidently disappear or be
refactored.
--
Ticket URL: <https://trac.macports.org/ticket/52699#comment:1>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list