CLion startup/loading new project causes toolchain issues.
Hi,
Forgive me for not being specific with the question but this has been driving me up the wall now.
Basically i am using CLion as my IDE for multiple different projects.
These are OS/Platform specific so some projects are only for Visual studio toolchain and some require WSL toolchains.
However everytime i start CLion or load a different project that uses a different toolchain via CMakePresets.json
I always get weird errors.
For example:
When loading a project with CmakePresets of “Visual Studio”
It fails to build the project the first time everytime until i manually reload CMake project.
And for a project with the toolchain specified in the vendor of CMakePresets.json to WSL:
I get this:
C:\Users\Alex\AppData\Local\Programs\CLion\bin\cmake\win\x64\bin\cmake.exe --build F:\Projects\Shellcore\Repos\Athena\Athena\build --target athena-kernel --config Debug -j 30
CMake Error: The current CMakeCache.txt directory F:/Projects/Shellcore/Repos/Athena/Athena/build/CMakeCache.txt is different than the directory /mnt/f/Projects/Shellcore/Repos/Athena/Athena/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
no such file or directory
CMake Error: Generator: build tool execution failed, command was: /usr/bin/ninja -j 30 -f build-Debug.ninja athena-kernel
At first i had WSL as the default toolchain in CLion because i was mainly compiling linux elf files but now im using CLion for windows projects too i was getting the same CMakeCache directory error on a windows project.
Forgive me if this is a lot of text but im at my limit of patience now and cannot understand why this happens.
Thanks
Please sign in to leave a comment.
Hello!
You can set a specific CLion toolchain in a configure preset - https://www.jetbrains.com/help/clion/cmake-presets.html#set-toolchain. Does it help?
Hi Anna,
Unfortunatley not,
I have a CMakePreset already for these projects.
No matter what happens i always get this error if i try to build when first loading the project.
It always requires me to Right click and “Reload CMake project”.
My CMakePresets is as follows:
For WSL project:
And for the Visual Studio MSBuild compiled project:
Alexboulton2013, let's start with the WSL project.
Hi Anna,
Here is the output of the CMake Window:
And the screenshot of the CMake from Settings:
When building after opening this is the output i receive:
Once i reload cmake project all works perfectly fine.
Has anyone managed to replicate this issue?
Im curious if anyone else has thi9s issue as i dont remember it doing it before an update but dont remember when.