CLion 2020.3 EAP: Enhancements to Run/Debug Configurations and CMake Profiles
In the previous 2020.3 EAP release, we introduced more profound support for Qt projects, enhancements for Google Test in the built-in test runner, and much more. This time we are focusing on improving the flexibility of existing functionality:
- An option to enable/disable CMake profiles in CLion.
For Run/Debug configurations:
- The ability to configure an environment before executing a configuration by running a script.
- The ability to edit a configuration while indexing is still running.
- Code With Me, a tool for collaborative development and pair programming, is now bundled in CLion!
Build 203.5419.20 is available from our website, via the Toolbox App, and as a snap package (if you are using Ubuntu).
Enable/disable CMake profiles in CLion
It may be convenient to keep several CMake profiles configured in CLion, for example, to check various toolchains or various sets of build types. When the profile is loaded, not only is CMake generation done and the project is ready to be built in this profile, but the corresponding resolve configurations in CLion are also available and you can switch between them instantly. For example, let’s say I have two local debug profiles with Apple Clang and the most recent Clang 10, as well as a remote Linux GCC-based profile. I might not use the remote one very often. In this case, I’d like CLion not to reload this profile every time I update the project’s CMake files (and fail if the machine is shut down), but only when needed. This is now possible with the new Enable profile option.
There are several ways to disable/enable CMake profiles in CLion:
In the CMake toolwindow, if the profile has failed to load, the Disable profile option is available:
If you want to disable a successfully loaded profile, check the configuration pop-up menu in the CMake toolwindow:
In this menu you can also enable any of the previously disabled profiles:
- And finally, you can enable/disable any of the configured profiles in Settings/Preferences | Build, Execution, Deployment | CMake.
When you enable/disable profiles, CLion incrementally reloads CMake to avoid inconsistencies when running, debugging, or simply coding in CLion’s editor. This doesn’t depend on the Automatic reload setting configurations of the profiles. Disabled profiles are grayed out in the profiles list in Settings/Preferences | Build, Execution, Deployment | CMake:
Information about enabled/disabled profiles is stored in the workspace.xml file in the project folder’s .idea directory.
More flexible Run/Debug configurations
In the Run/Debug configuration settings you can customize user and system environment variables. Now you can also point CLion to a script that configures the environment:
CLion will run this script each time the corresponding configuration is launched, after all the Before launch steps have finished. The environment created by the script is applied only to a single run of this configuration, without any side effects. Note:
- The environment configured by the script takes precedence over the variable values provided in this dialog.
- All toolchains (including remote toolchains) are supported.
- CMake, Gradle Native, Custom Build, Makefile Applications, as well as all test configurations (CTest, GTest, Boost.Test, Catch, Doctest) are supported.
- If you need the ability to run the script before building the configuration, this is not yet possible. However, we have plans to implement it in the future (CPP-11768).
From now on, all the Run/Debug configurations can be edited while project indexing is running!
Code With Me
CLion 2020.3 EAP adds support for Code With Me – a tool for collaborative development and pair programming:
This functionality is available free and ready to use out of the box during the EAP, but it will be unbundled before the 2020.3 release. If you are interested in the supported workflows and future plans, you can learn more about them in this blog post.
Your CLion team
The Drive to Develop