Unable to select alternate cmake profile

已完成

I am currently using clion on windows. I am attempting to configure a wsl environment so I can use Valgrind Memcheck. I have configured the new WSL toolchain and have created a new cmake profile using the wsl in settings. However, when I click the dropdown for run configurations, it still only shows the original debug profile, and doesn't let me choose the other one. I'm not sure what I'm doing wrong that allows the profile to show up in settings but not as a run configuration.

0

Hello!

How many tabs do you see in the CMake tool window?

Was a cmake-build-<name of your WSL profile> subfolder generated?

0
Avatar
Permanently deleted user

Hello I also have this problem intermittently occurring, when using remote build toolchains in two different profiles. I have both tabs in the Cmake tool window, but only one option in my run configurations

0

@... please note that CLion filters profiles and shows only those profiles which are relevant for the selected run configuration. Do you have any conditions set in your CMakeLists.txt?

0

I'm also having a similar issue. I'm using the recently-added shared CMake profiles, and the `.idea/cmake.xml` file is in source control. In the original project directory where I first created the CMake profiles, they all show up correctly in the Run/Debug Configurations dropdown, so I know they aren't being filtered by conditions in the CMakeLists.txt files. However, if I create a feature branch and check it out into a separate working directory, I only see about half of the shared profiles in the dropdown when I open the project from the new directory. I have confirmed that all of the shared CMake profiles show up in Preferences in the new project directory, but I can't select them for building the project.

0

Hi Kenny Pitt!

1) Do you check out the branch on the same machine?

2) How many tabs do you see in the CMake tool window if you do `Tools | CMake | Reset Cache and Reload Project`?

0

I think I may have just found the problem in my case. The "target" that was selected by default when I opened the new project directory was not the same as the target that was currently selected in the original project directory. That particular default target happens to be one that is excluded in some of the CMake profiles. It seems that CLion always lists all of the possible targets for all profiles in the Run/Debug dropdown, but it filters the list of profiles based on the target that is currently selected. So, even though the profiles and the targets are "independent", you MUST select the target first and then select one of the profiles that is valid for that target.

This is a somewhat confusing behavior because it isn't consistent between profiles and targets. It would be helpful if you could also select from any of the available CMake profiles and see which targets are available in that profile.

This behavior is with CLion 2021.2, Build #CL-212.4746.93.

0

>It seems that CLion always lists all of the possible targets for all profiles in the Run/Debug dropdown, but it filters the list of profiles based on the target that is currently selected.

Indeed it does. CLion filters the list of profiles it suggests depending on whether this target supports this profile.

Feel free to share your opinion about this behavior in the comments to https://youtrack.jetbrains.com/issue/CPP-26014.

0

请先登录再写评论。