Dess
Dess

Reputation: 2649

CMake creates x64 or Win32 directory outside its Build directory

In CMake, I usually create a 'Build' directory at the root level of my source tree. I then CD into this directory, and do:

CMake .. -G "..."

In the past, all the CMake-related files would be created within this 'Build' directory. However, I now notice (after switching to new version of CMake, 3.7) that there is an 'x64' or 'Win32' file created in the root of the source tree when I build the project in Visual Studio.

How can I make it so that CMake creates these 'x64' or 'Win32' directories within the 'Build' directory and not in the parent directory, which is the root of the codebase?

Upvotes: 1

Views: 741

Answers (1)

morph208
morph208

Reputation: 110

Are you using Visual Studio 2017? From the tags you have chosen, I think you are. There is actually a bug with Visual Studio 2017. You can read more details about it here since it has been first reported as a CMake bug.

In a nutshell, it seems to occur only when using "Rebuild" from the IDE. It results in a x64 (or Win32) folder being created in the root folder along with intermediate log files and such from ALL_BUILD and ZERO_CHECK projects.

The issue has been closed by CMake 18 hours ago as it has been confirmed that this bug was fixed in Visual Studio 15.3.0.

Hope this helps.

Upvotes: 1

Related Questions