Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute cmake in docker container #8

Open
grachchr opened this issue Mar 10, 2021 · 3 comments
Open

Execute cmake in docker container #8

grachchr opened this issue Mar 10, 2021 · 3 comments

Comments

@grachchr
Copy link

Hello, first of all thank you for the excellent tool. But I still have a question about the operation with docker.

Is it possible to start the execution of cmake (right click on EclipseProject -> CMake -> Toolchain -> MyToolchainFile) in a docker container. Instead of running cmake on the host. If yes, what do i need to do for this? (Maybe via the entry: Eclipse -> Window -> Prefereces -> CMakeHelper -> Paths -> Optional path to CMake binary)

Thanks a lot

@DeHecht
Copy link
Owner

DeHecht commented Mar 10, 2021

Hello,
I investigated a little and I think it is not (yet) possible. Currently, you might get the cmake call to run in a container but then the make call would still be executed on host.
The plugin uses the CDT4 Eclipse generator, so the CMake executable sets up the eclipse project. I would need some more post processing there to have the make also being called within the same container.

It could work actually, but Eclipse might have troubles with the indexer and displaying errors (unless the project is mounted at the same location within the container).

Do you use multiple different build containers?

@grachchr
Copy link
Author

grachchr commented Mar 16, 2021

Hello thank you for the quick reply. Yes the project is mounted in the same place within the container. The Eclipse ".project" file can refer relatively to the source code. This allows the indexer to work without errors.

Example for .project file:
<link>
<name>My_Virtual_Link_SrcDir/MyFile.cpp</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/My_Relative_Location_SrcDir/MyFile.cpp</locationURI>
</link>

Example-Tree:
'/mnt

| - MyMount
    | - MyCommonSrcs
    | - MyProjects
        | - MyProject
            | - src 
            | - .cproject
            | - .project
            | - CMakeLists.txt'

<< Do you use multiple different build containers?
Yes, these are managed via the Eclipse Container Settings. (EclipseProject -> Properties -> C++Build -> Settings -> Container Settings). "Current toolchain" is set to "CMake driven" and "Current builder" is set to "CMake Builder" (EclipseProject -> Properties -> C++Build -> Tool Chain Editor).

@DeHecht
Copy link
Owner

DeHecht commented Mar 21, 2021

I see. So the idea is to give the context menu a different implementation when having CDT setup for CMake. I have to check this out and play around a little with it. It is different from how the plugin works right now, but this does not have to be an obstacle.

I keep you informed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants