Turning my comment into an answer:
In case anyone did what I did, which was start by putting all the build files in the source directory:
cd src
cmake .
cmake will put a bunch of build files and cache files (CMakeCache.txt
, CMakeFiles
, cmake_install.cmake
, etc) in the src
dir.
To change to an out of source build, I had to remove all of those files. Then I could do what @Angew recommended in his answer:
mkdir -p src/build
cd src/build
cmake ..