conan-clion-plugin
conan-clion-plugin copied to clipboard
Build, run, debug in Conan shell environment
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?
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?
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?
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.
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.
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.