Pio init for Clion fails


I run pio init -b ATmega644A --ide=clion
but when I opened the project in Clion the following error message appeared:

"C:\Program Files\JetBrains\CLion 2020.2.4\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=C:/Users/xxx/MinGW/bin/mingw32-make.exe -DCMAKE_C_COMPILER=C:/Users/xxx/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe -DCMAKE_CXX_COMPILER=C:/Users/xxx/.platformio/packages/toolchain-atmelavr/bin/avr-g++.exe -G "CodeBlocks - MinGW Makefiles" C:\Users\xxx\onc\study\hsis\avr_atmegaA644
-- Configuring done
CMake Error at CMakeLists.txt:33 (add_executable):
  No SOURCES given to target: Z_DUMMY_TARGET

CMake Generate step failed.  Build files cannot be regenerated correctly.

[Failed to reload]

Can anybody tell me what to do that the project can be loaded?

Best regards,

Is your src/ folder empty by chance? Just put a main.cpp file in there.

It might also happen on the very first usage of PlatformIO where no framework and toolchain has been installed yet. Just Tools -> PlatformIO -> Build once and Tools -> PlatformIO -> Re-Init then.

No, creating a main.cpp file does not help at all.
You have to register the file in the CMakeLists.txt manually, did not happen automatically.
And after that you get this error:

CMake environment setup is described in the docs.