Bug 375745 - cmake subprojects in a single session
Summary: cmake subprojects in a single session
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-30 10:36 UTC by RJVB
Modified: 2022-11-29 05:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2017-01-30 10:36:11 UTC
I have a CMake-based project that can be configured as follows:
- build everything (host application + library, default)
- build the host application and associated infrastructure only (a bit like VLC)
- build only the library (think libVLC)

At the cmake level this is implemented very simply with add_subdirectory() calls that are or are not made.

What I'd like to be able to do is:
- maintain a single source directory
- maintain 2 (out-of-source) build directories, one for the host, one for the library. There are good reasons why I want a separated approach like this, instead of using a single build directory and telling make to build only a specific target.

I'd then like to open projects for both in a single KDevelop session so that I can edit files from both parts of the actual source project with full parser support.

This turns out to be very tricky. It seems that the CMake project manager maps a given open file to a given session project by matching the project toplevel directories to the file path on a first-come basis. 

Currently there's only one way to achieve something more or less what I am looking for, and that's by adding multiple build directories to a single project. That'd work if
- cmake weren't invoked automatically each time one changes build directories
- changing build directories were possible without diving into the project configuration dialog. Ideally there'd be a pop-up menu (or contextmenu submenu) for each file that's part of a project that lists the known build directories that build the file in question. I think that information is readily available from the compile_commands.json files from the build directory roots.
Comment 1 Justin Zobel 2022-10-30 00:37:52 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 2 Bug Janitor Service 2022-11-14 05:15:49 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2022-11-29 05:19:29 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!