Fix build issues when using CMakeLists.txt in a subdirectory
The configure code was using the VCS root directory when it should have been using the project directory, and the build code was using the project directory when it should have been using the VCS root directory.