Establish `conda` environment
All the documentation I could find about using a `conda` environment is related to `python`.
I am using `conda` to install C++ tooling like `cmake` and `conan`.
I want to be able to select `conda` environments in `CLion` when doing C++ development.
It seems the approach is to use a script to configure the environment.
https://www.jetbrains.com/help/clion/how-to-create-toolchain-in-clion.html#env-scripts
The example script referenced is buried in the yocto system.
I found the ticket where the capability was added but I am not finding an example.
https://youtrack.jetbrains.com/issue/CPP-11768/Ability-to-initialize-toolchain-environment-via-script
I presumed the script is something like the following:
#!/bin/bash -e
conda activate cts
export CMAKE=$(type -p cmake)
...but that does not appear to work.
Could you provide a sample script?
Please sign in to leave a comment.
You can create a symlink for the actual CMake location in the script to a known location, and specify this path to this CMake symlink in CLion's toolchain panel. Does this work?
https://www.jetbrains.com/help/clion/how-to-create-toolchain-in-clion.html#env-scripts --
"You can point CLion to the script that initializes the environment for your project without the need to set the variables manually.
This is helpful, for example, when you need to initialize compiler variables, add custom ones, or modify the
PATH.""a toolchain is a set of all the necessary tools required for building and running your application:
You are saying the script only directly sets the working environment?
That is, the other objects in the toolchain may only be indirectly modified by the environment script?
How does Intellij / CLion go about detecting the other elements of the toolchain? It looks like CMake and the debugger must be fully specified (or use the bundled version) and then `cmake` is used to detect the build-tool, c-compiler, c++compiler.
Is this correct?
Thanks, with a slight modification to your approach I got the desired behavior.
Rather than a symlink I use a `cmake-wrapper.sh`.
In conjunction with the following environment script.
I can probably simplify this second script, but you get the idea.
It would be nice if this `cmake-wrapper` behavior were added to the list of options {Bundled, Custom, Env-Variable}.