0
votes

Is there any way to specify where CMake should create its build files? I mean some kind of set function. I want to run CMake in root directory and get its files in /build directory.

Files I want to put to build directory: CMakeFiles/ cmake_install.cmake CMakeCache.txt Makefile

1

1 Answers

0
votes

You can specify the build directory using the -B flag. You can invoke cmake from anywhere by using the -H flag, which provides the source directory (with the CMakeLists.txt file).

cmake -H/path/to/source -B/path/to/build