Discussion:
"Build" command in a project's subdirectory (CMake project)
René J.V. Bertin
2016-05-13 13:54:33 UTC
Permalink
Hi,

With KDevelop 4.7, one could select a project's subdirectory containing a Makefile (as shown by the folder icon), issue a "Build" via the keyboard shortcut or context menu, and KDevelop would issue a make command in the selected directory.

That seems no longer the case with KDevelop 5, and I find that a pity. Was this by popular request? It would seem to me that the "Build Selection" menu should still build only what's selected (if that selection corresponds to a build unit), and that it would be perfectly possible to add dedicated commands for "build whole project".

I know one can select and build one of the build targets, but that's become less useful for big projects you don't know intimately. KDevelop 4.7 could expand those targets to show which files it depended on (so you could see which target to build after modifying a given file), but that feature has gone with the dodo too.

Thoughts?
R.
Yavuz Mert
2016-05-13 14:13:08 UTC
Permalink
Hi,
On projects toolview of 5.X, there is new a tool button -the second one from
left- with the hint "Show Targets"
If that is selected I can right click the target and build the individual
target, but not the directory.

I checked with Kdevelop 4.7 and it also acts the same way, you can build
individual cmake targets, but not the subdirectory. The only difference I can
see is on 4.7 the targets are always shown, there is no checkbutton. So,
AFAICS the functionality is same.

yavuz
Post by René J.V. Bertin
Hi,
With KDevelop 4.7, one could select a project's subdirectory containing a
Makefile (as shown by the folder icon), issue a "Build" via the keyboard
shortcut or context menu, and KDevelop would issue a make command in the
selected directory.
That seems no longer the case with KDevelop 5, and I find that a pity. Was
this by popular request? It would seem to me that the "Build Selection"
menu should still build only what's selected (if that selection corresponds
to a build unit), and that it would be perfectly possible to add dedicated
commands for "build whole project".
I know one can select and build one of the build targets, but that's become
less useful for big projects you don't know intimately. KDevelop 4.7 could
expand those targets to show which files it depended on (so you could see
which target to build after modifying a given file), but that feature has
gone with the dodo too.
Thoughts?
R.
_______________________________________________
KDevelop mailing list
https://mail.kde.org/mailman/listinfo/kdevelop
René J.V. Bertin
2016-05-13 14:39:32 UTC
Permalink
Post by Yavuz Mert
If that is selected I can right click the target and build the individual
target, but not the directory.
Yes.
Post by Yavuz Mert
I checked with Kdevelop 4.7 and it also acts the same way, you can build
individual cmake targets, but not the subdirectory. The only difference I can
see is on 4.7 the targets are always shown, there is no checkbutton. So,
AFAICS the functionality is same.
Do you have things configured to use CMake's Ninja generator instead of the "Unix Makefiles" generator?
That one indeed behaves like that; it can hardly do any different since you only get a .ninja file in the top level directory.
But I double-checked: this is the 1st line of KDevelop 4.7's Build view after I hit Build with a subdir. selected (build.dir shortened):

/.../kf5-kdevplatform-devel/work/build/plugins/grepview> wmake --nice 10 -w VERBOSE=1

That first line is followed by significantly fewer further output lines
(wmake is a wrapper script of my own).


R
Yavuz Mert
2016-05-13 15:03:30 UTC
Permalink
Sorry, my bad. Now I see your point, you are right.
In 4.7 I can build the sub directory with context menu.
Since I generally create sub targets in sub directories, I do not need that,
but yes, there may be cases to build in the specific directory.
Post by René J.V. Bertin
Post by Yavuz Mert
If that is selected I can right click the target and build the individual
target, but not the directory.
Yes.
Post by Yavuz Mert
I checked with Kdevelop 4.7 and it also acts the same way, you can build
individual cmake targets, but not the subdirectory. The only difference I
can see is on 4.7 the targets are always shown, there is no checkbutton.
So, AFAICS the functionality is same.
Do you have things configured to use CMake's Ninja generator instead of the
"Unix Makefiles" generator? That one indeed behaves like that; it can
hardly do any different since you only get a .ninja file in the top level
directory. But I double-checked: this is the 1st line of KDevelop 4.7's
/.../kf5-kdevplatform-devel/work/build/plugins/grepview> wmake --nice 10 -w VERBOSE=1
That first line is followed by significantly fewer further output lines
(wmake is a wrapper script of my own).
R
René J.V. Bertin
2016-05-13 15:38:22 UTC
Permalink
Post by Yavuz Mert
Sorry, my bad. Now I see your point, you are right.
Nah, it's just the day/date ;)
Post by Yavuz Mert
In 4.7 I can build the sub directory with context menu.
Since I generally create sub targets in sub directories, I do not need that,
but yes, there may be cases to build in the specific directory.
A subdirectory may contain multiple targets (that you may want to build), and as I said, you don't always know which target has to be built when you modify a given file in a project you're not very familiar with.

R
Matthew Woehlke
2016-07-15 14:01:18 UTC
Permalink
Post by René J.V. Bertin
Post by Yavuz Mert
I checked with Kdevelop 4.7 and it also acts the same way, you can build
individual cmake targets, but not the subdirectory. The only difference I can
see is on 4.7 the targets are always shown, there is no checkbutton. So,
AFAICS the functionality is same.
Do you have things configured to use CMake's Ninja generator instead of the "Unix Makefiles" generator?
That one indeed behaves like that; it can hardly do any different since you only get a .ninja file in the top level directory.
Note that sufficiently new CMake will generate 'directory targets' for
ninja. It would be great if KDevelop could integrate with these when
they are available.
--
Matthew
Aleix Pol
2016-05-15 08:46:14 UTC
Permalink
Post by René J.V. Bertin
Hi,
With KDevelop 4.7, one could select a project's subdirectory containing a Makefile (as shown by the folder icon), issue a "Build" via the keyboard shortcut or context menu, and KDevelop would issue a make command in the selected directory.
That seems no longer the case with KDevelop 5, and I find that a pity. Was this by popular request? It would seem to me that the "Build Selection" menu should still build only what's selected (if that selection corresponds to a build unit), and that it would be perfectly possible to add dedicated commands for "build whole project".
There's still the possibility to build a target.
Post by René J.V. Bertin
I know one can select and build one of the build targets, but that's become less useful for big projects you don't know intimately. KDevelop 4.7 could expand those targets to show which files it depended on (so you could see which target to build after modifying a given file), but that feature has gone with the dodo too.
Yes, we dropped the CMake parser, that's what we get.

Aleix
René J.V. Bertin
2016-05-15 09:25:22 UTC
Permalink
Post by Aleix Pol
Yes, we dropped the CMake parser, that's what we get.
Not necessarily I think: there's still the possibility to change into the selected directory and issue the make command in there. AFAICT that's how it was implemented before. A feature that could be provided only when using Unix Makefiles, or rather, disabled for directories not containing a Makefile and projects not using make.

With a few pointers where to start I'd be more than willing to give this a try, because I miss the feature enough to spend some time on it.
As I said, displaying the list of targets, figuring out which to build (try that for an autoconf-based project ...) and building just that is indeed a possibility, but too often too cumbersome. For me that sort of feature is exactly one of the reasons to use a full-blown IDE.

R.
Loading...