What is build directory?
I'm trying to build Audacity following the instructions in https://github.com/audacity/audacity/blob/master/BUILDING.md And the second last step:
$ cd <build directory>
what does this means? And how can I build the software?
Solution 1:
With cmake-based programs, you first use cmake
to configure it and then use make
to actually do the compilation.
You can run cmake
in the same directory where the source code is, but that is generally messy because all the object files and executables will be located in the same directory as the source code. I think the documentation calls this an "in-source build".
The instructions for cmake
usually suggest creating a build directory. I think the documentation calls this an "out-of-source build". It can be any new directory. Once you're inside, then type cmake <path to where the CMakeLists.txt is>
. Then, in this directory, do the make
to perform the compilation. When you're all compiled and installed, just removed this build
directory.
And yes, it is usually called build
in various documentations, but it can be called anything. It's just a temporary directory. If the developers of the software provided a facility to install the program (i.e., via make install
) then the executables will be copied elsewhere.
Hope this helps!