Discussion:
cmake question
René J.V. Bertin
2018-09-20 09:19:23 UTC
Permalink
Hi,

This is not a kdevelop question per se, but about something that kdevelop users may notice more often than "joe cmake" users:

Is there a way to generate all the autogen stuff after running cmake? For instance, if you import a fresh kdevelop source tree into a kdevelop project it will run cmake and thus figure out all dependencies, where headers are etc. Most parsing will thus succeed, but not that which requires headers and other stuff that is generated during a build (moc files, translated .ui files, ...).

It'd be really useful if you could generate just that in a single. Does anyone know if this is possible (might not be depending on cmake alone)?

Thanks,
René
Sven Brauch
2018-09-20 09:36:15 UTC
Permalink
Post by René J.V. Bertin
Is there a way to generate all the autogen stuff after running cmake?
I don't think this is possible in the general case, since targets have
dependencies between them and the autogen targets may well depend on compile
targets. That's not even super unrealistic, think e.g. kdev-pg-qt generating
its own parser generator from its grammar during bootstrap and running automoc
on the intermediate output files (not sure if it runs automoc, but you get the
point).

Best,
Sven
René J.V. Bertin
2018-09-20 10:21:21 UTC
Permalink
Post by Sven Brauch
I don't think this is possible in the general case, since targets have
dependencies between them and the autogen targets may well depend on compile
targets. That's not even super unrealistic, think e.g. kdev-pg-qt generating
Sure, but the dependency information is there, otherwise a full build would fail too. The question is not if you could generate this information without ever doing a full build but more if cmake could create a target that generates (almost) all those auto things without always doing a full build.

I just tried a build of kdevastyle_autogen (because that's what I'm tinkering with ATM), and that builds the entire kdevastyle source, for some reason, plus seemingly unrelated things like the entire KDevPlatformUtil plugin.

Yet I think we all have noticed that many projects start by doing a possibly very large number of generator operations. Apparently KDevelop is not in that class ... would I be mixing up with qmake-based projects?
Friedrich W. H. Kossebau
2018-09-20 12:08:55 UTC
Permalink
Hi,
Post by René J.V. Bertin
This is not a kdevelop question per se, but about something that kdevelop
Is there a way to generate all the autogen stuff after running cmake? For
instance, if you import a fresh kdevelop source tree into a kdevelop
project it will run cmake and thus figure out all dependencies, where
headers are etc. Most parsing will thus succeed, but not that which
requires headers and other stuff that is generated during a build (moc
files, translated .ui files, ...).
It'd be really useful if you could generate just that in a single. Does
anyone know if this is possible (might not be depending on cmake alone)?
Not aware of such a feature (in any build system generator), but I would very
much agree that it would be very helpful to have something like this, a build
target which could be used to ensure that any generated source has been
generated.

This is something I am missing very much when using KDevelop just for reading
existing codebases, but not actually working on them or running them.

Next to KDevelop's code parser this would also benefit other code parsing
tools which prefer to have a full understanding of the semantics, like static
code analyzers (clazy, clang-tidy) or documentation tools.

Someone(tm) should start an initiative to add such a generalized thing to
cmake, so there is a standard target pattern.

Cheers
Friedrich

Loading...