What is the equivalent of $(ProjectDir) and $(TargetDir) in CLion and how to change?

Answered

Hi!

I need to set my working directory points to the folder with the executable because files are searched relative to that. In Visual Studio that is the same as $(TargetDir). The default is $(ProjectDir) in Visual studio (which will not work for my case!).

So, my question is, how to change the and set the working directory in CLion? I am using Ubuntu 22.04. 

3 comments
Comment actions Permalink

Hello!

>I need to set my working directory points to the folder with the executable because files are searched relative to that

This is the default value for the "Working directory" field, so you don't need to change anything. 

0
Comment actions Permalink

You meant this? Adding manually the file path? Different for debug and release? 

0
Comment actions Permalink

The default value for this field is the build directory where the resulted executable is located. Therefore you don't need to specify anything in this field, since the default value is exactly what you need, as far as I understand.

0

Please sign in to leave a comment.