4

I've been using CLion with a certain repository of mine for a while now. Suddenly (or maybe not suddenly, but I can't figure out the cause), I get this error message in the CMake console:

Cannot generate into /path/to/the/project/dir
It is already used for unknown project

Please either delete it manually or select another generation directory

I tried several things:

  • Deleting the build directories
  • Deleting .idea and opening the directory as a new project
  • Ensuring there are no other instances of CLion in the background
  • Checking the file ownership and permissions

... but to no effect. However, cloning the repository into a new folder does not result in this situation.

What could be the cause of this problem?

Notes:

  • CLion 2022.1 EAP 3
  • Devuan GNU/Linux Chimaera (~= Debian Bullseye)
  • non-root user
einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • Are you using multiple builds eg Debug/Release? It seems like there are some issues with that (eg https://stackoverflow.com/questions/49656740/clion-contexts-and-cmakecache). I was able to solve a similar issue by deleting the build files and CMakeCache and then invalidating caches and restarting. – soothsooth May 10 '22 at 11:49
  • @soothsooth: I was using different build configurations, yes. But I'm not experiencing the issue right now... – einpoklum May 10 '22 at 13:31
  • Since you have the privilege of access to your machine, could you try producing steps to reproduce the problem? – starball Jan 13 '23 at 21:02
  • @starball: Unfortunately, I can't reproduce it right now. Almost a year has passed... I must have done something to make it go away. – einpoklum Jan 14 '23 at 10:43

1 Answers1

4

Had the same problem. Deleting CMakeCache.txt in the project (root) directory did the trick for me.

einpoklum
  • 118,144
  • 57
  • 340
  • 684
HolKann
  • 678
  • 9
  • 15