Issue
I am trying to setup my CLion on Windows with WSL, following the official tutorial: https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html
When setting up the Toolchains, and now in the editor, I am getting the same error after the identification of the C compiler and features, C++ compiler and features. The lines causing the error are always the same:
configure_file(
${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake
@ONLY
)
I am using Windows Subsystem for Linux 2 with Ubuntu 20.04, GCC and G++ version 9.3.0.
Please help me diagnose the problem.
Solution
I had the same problem.
I found the solution here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003413779-Troubles-with-WSL-toolchain-Test-CMake-run-finished-with-errors-
To summarize, you should create a wsl config file /etc/wsl.conf
and add the following lines:
[automount]
options = "metadata"
enabled = true
After this you should reboot your wsl (in powershell).
wsl.exe -l // gets a list of your linux distributions
wsl.exe -t *name-of-your-distribution*
Answered By - morras