Opened 8 years ago

Last modified 7 years ago

#52699 closed enhancement

cmake portgroup version 1.1 — at Version 3

Reported by: mkae (Marko Käning) Owned by: mkae (Marko Käning)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: RJVB (René Bertin), mojca (Mojca Miklavec), michaelld (Michael Dickens), ryandesign (Ryan Carsten Schmidt)
Port: cmake

Description (last modified by mkae (Marko Käning))

... as well as Ryan, of course.

Change History (4)

Changed 8 years ago by mkae (Marko Käning)

Attachment: cmake-Portgroup.diff added

comment:1 Changed 8 years ago by RJVB (René Bertin)

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.

comment:2 Changed 8 years ago by mkae (Marko Käning)

Cc: mojca michaelld added

Adding two cmake'ish devs for review.

comment:3 Changed 8 years ago by mkae (Marko Käning)

Cc: ryandesign added
Description: modified (diff)

As well as Ryan, of course.

Note: See TracTickets for help on using tickets.