Are you using the CLion plugin as described in the documentation? CLion — PlatformIO latest documentation and https://plugins.jetbrains.com/plugin/13922-platformio-for-clion.
Please exactly follow the installation and setup method for a project as outlined in the doc.