conan-clion-plugin icon indicating copy to clipboard operation
conan-clion-plugin copied to clipboard

Build, run, debug in Conan shell environment

Open petermbauer opened this issue 6 years ago • 8 comments

It would be great to have CLion make use of the activate.bat generated by the virtualenv generator so tools like CMake itself, Ninja, Compilers, ... can be installed via Conan too. Maybe this is already possible somehow?

petermbauer avatar Jun 16 '19 14:06 petermbauer

If we provide a toolchain from Conan, then we should be able to use it into CLion (Preferences > Build, Executions,... > Toolchains) and it would do the work, right?

jgsogo avatar Aug 14 '19 14:08 jgsogo

I am not sure what you mean by that. Are you describing a possible way to implement this (a new type of toolchain) or that it should already work when configuring a toolchain with the tools installed by Conan into the local cache?

petermbauer avatar Aug 16 '19 18:08 petermbauer

Sorry for the so short explanation.

There is an on-going work related to local commands, build helpers and generators; not sure if we will be able to release it as Conan v1.x or we'll need to wait for v2.0 because it may break existing behavior. The idea is that conan install <conanfile.py> should always generate two files: one with dependencies information (like FindXXX.cmake files) and another one with a toolchain. The toolchain will be used by Conan to compile the libraries but it could be also used for local commands, IDEs, tools,... to reproduce the build environment, configuration and everything needed locally to match the binary that would be generated by Conan.

That toolchain file could be added to CLion and, if it contains all the information of the build requirements (CMake, Ninja, compilers,...), and CLion honors it, it would have the same effect as activating the virtualenv.

That's the idea, although there is still much work left.

jgsogo avatar Aug 19 '19 09:08 jgsogo

Thank you for the explanations. Sounds promising and like a cleaner approach but activating the virtualenv in a subshell seems a lot easier to implement.

petermbauer avatar Sep 13 '19 07:09 petermbauer

Link to https://github.com/conan-io/conan/issues/5737, it should gather the attention about this topic. There are also some considerations about the environment.

jgsogo avatar Sep 13 '19 07:09 jgsogo