How to tell CMake where to put build files?

You can use the undocumented command line options -B and -H to specify your build directory and source directory respectively. So, from your project’s root, you can do:

cmake -Bbuild -H.

(Where build is your build directory path.)

Leave a Comment