[CMake] What controls where cmake writes the build files?

Nils Gladitz nilsgladitz at gmail.com
Sat May 17 13:30:12 EDT 2014


On 17.05.2014 18:43, Rick McGuire wrote:
>
> Today, I wanted to create a third build subdirectory so I could start 
> work on NSIS installer builds.  However, when I run the cmake command 
> with the NMake Makefiles generator (the same generator used for the 
> other builds), it is insisting on writing the files to the root of the 
> source tree (the same directory containing the CMakeLists.txt file) 
> rather than in the current directory?  I've tried all sorts of 
> combinations here, but can't seem to replicate my earlier success at 
> creating the debug and release subdirectories originally.  What's 
> going on here?
>

Maybe you accidentally performed an in-source directory configuration at 
some point (does your source directory contain CMakeCache.txt/CMakeFiles?).
CMake can be given a source directory or an existing build directory.
If it is given an existing build directory (which may happen to coincide 
with the source directory in case you did perform an in-source directory 
configuration) it will not create a new build directory.

Try cleaning up the source directory (remove at least 
CMakeCache.txt/CMakeFiles) and try again.

Nils


More information about the CMake mailing list