MantisBT - CMake
View Issue Details
0015490CMake(No Category)public2015-04-01 16:252016-06-10 14:31
Stephen Kelly 
Kitware Robot 
normalminorhave not tried
closedmoved 
 
 
0015490: Provide a stable interface to the cmake cache for external tooling

External tooling typically parses the CMakeCache.txt file directly in order to extract essential information. The format of the file, and how to parse it are not documented, and it does not have documented stability guarantees.

There is a need for tooling to read (and possibly write) cache values, so some stable interface should be provided. That can either mean

1) A new format in a new file
2) Documenting the existing format.

The first option has the advantage that a common format for structured documents can be chosen (such as json).

The second option has the advantage that external tooling does not need to wait for a new CMake version to generate a new file, because the existing format has not changed in a long time (and maybe can't change because of de-facto stability requirements for existing tools).
No tags attached.
Issue History
2015-04-01 16:25Stephen KellyNew Issue
2015-04-01 16:30Stephen KellyNote Added: 0038386
2015-04-01 16:30Stephen KellyNote Edited: 0038386bug_revision_view_page.php?bugnote_id=38386#r1741
2015-04-01 16:38David ColeNote Added: 0038389
2015-04-02 06:21Tobias HungerNote Added: 0038390
2015-04-02 07:51Anton MakeevNote Added: 0038391
2015-04-02 08:10Tobias HungerNote Edited: 0038390bug_revision_view_page.php?bugnote_id=38390#r1743
2015-04-02 08:13Tobias HungerNote Added: 0038392
2015-04-02 12:57Stephen KellyNote Added: 0038393
2016-06-10 14:29Kitware RobotNote Added: 0042749
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038386)
Stephen Kelly   
2015-04-01 16:30   
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/12658/focus=12868 [^]

Another idea is a command line interface which prints requested values on stdout. Mentioned somewhere here, along with reasons this stable interface is needed:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/12658/focus=12784 [^]

(0038389)
David Cole   
2015-04-01 16:38   
I vote for option number 2 -- documenting the existing format.

It's not hard to parse. CMake does it all the time...

It would be silly to change CMake just for convenience of external tools when they have to deal with multiple versions of CMake in the wild anyhow.
(0038390)
Tobias Hunger   
2015-04-02 06:21   
(edited on: 2015-04-02 08:10)
As one possible consumer of said file: I'd prefer option 1.

A new file keeps the CMake internals nicely separate of the information you provide to 3rd party tools, can be written in a format that does not require a custom parser.

PS: Those "-ADVANCED" variables should be hidden away in a non-public place:-)

(0038391)
Anton Makeev   
2015-04-02 07:51   
1) A new format in a new file

This option assumes that this file is either read-only, or CMake will have to decide which file to prefer when regenerating the project - CMakeCache.txt or this new file

2) Documenting the existing format.

It's easily parseable by both the code and by the user, making it versatile.
My vote for documenting what we have now.
(0038392)
Tobias Hunger   
2015-04-02 08:13   
Yes, I think this should be a *read-only* interface. You can already run cmake and other tools to change settings.

Stephen, Anton and me are discussing an IDE-metadata file. In my opinion that would be the best place to put a read-only dump of the configuration. That way an IDE only needs to read one file in one format.
(0038393)
Stephen Kelly   
2015-04-02 12:57   
I believe I have a solution for the problems mentioned, but I want to do some more research before posting an updated design.
(0042749)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.