I'm using CMake to build the code. It creates a subdirectory src/a.out and stores the output file. Until now I'm defining the path manually if I want to store the created file some place else e.g., like this
std::ofstream ofile;
ofile.open("/home/results/foo.txt");
I'd like to know is there a way I can define the path in CMake rather than in code?