I have a cmake based C++ project done with QtCreator. I wrote the CMakeLists.txt files manually. When building either from the command line of from QtCreator, I get this directory structure, as expected:
MyProj/ - source code
MyProj_build/ - object files and executable; I launch cmake from here
Now I would like the build directory to be on a different disk (a ram disk):
/PathToRamDisk/MyProj_build/
When building from the command line, I launch cmake/make from the new build directory, and all the generated files are located in that directory. Fine.
From QtCreator, even if I change the build path to the new one (Options/Build & Run/General/Default build directory), the build is still done in the old directory. Is there another path to change? Where?
Platform: QtCreator 3.3.0, Mac OSX
You can click the Project button on the left side of QtCreator, then you can specify the output directory. Notice, the default is for debug version, you need to specify the release version folder either.
Once you set a different folder, you will see that you need to rerun the cmake command to generate these files. This should work, I also use it on Mac.
You can change default build directory template By changing the Default build directory setting in Options->Build & Run.
Or directly in ~/.config/QtProject/QtCreator.ini:
[...]
[Directories]
BuildDirectory.Template=.../%{JS: Util.asciify("build/%{CurrentProject:Name}/%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}")}
[...]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With