[cmake-developers] [CMake 0015603]: CMake ignores the configured Visual C/C++ compiler

Mantis Bug Tracker mantis at public.kitware.com
Wed Jun 3 13:46:26 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15603 
====================================================================== 
Reported By:                Jan Ciger
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15603
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-06-03 13:46 EDT
Last Modified:              2015-06-03 13:46 EDT
====================================================================== 
Summary:                    CMake ignores the configured Visual C/C++ compiler
Description: 
CMake Visual Studio 2013 generators (probably other versions too, but not
tested) will select incorrect architecture, regardless whether or not
"vcvarsall.bat amd64" was executed beforehand.

cmake . (with no generator specified) will configure 32bit build
cmake -G "Visual Studio 12 2013" will still configure only a 32bit build (the
only VS 2013 generator listed in the --help output)

On the other hand
cmake-gui offers 3 (!) generators: 
"Visual Studio 12 2013" (probably 32bit build?)
"Visual Studio 12 2013 Win32" (32bit build)
"Visual Studio 12 2013 Win64" (64bit build)

with the 64bit build being the default.

This behaviour is rather inconsistent:

* Both tools should be offering the same generators
* The tools should offer the correct, currently configured toolchain because
otherwise all kinds of issues happen due to the Microsoft's tools being
misconfigured. 

The Microsoft batch files set the following env variables that can be used to
identify the current setup:

64bit tools targetting 64bit native build
@set Platform=X64
@set CommandPromptType=Native

64bit tools cross-compiling for 32bit 
@set Platform=X86
@set CommandPromptType=Cross
@set PreferredToolArchitecture=x64

64bit tools cross-compiling for ARM
@set Platform=ARM
@set CommandPromptType=Cross
@set PreferredToolArchitecture=x64

etc.



====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-06-03 13:46 Jan Ciger      New Issue                                    
======================================================================



More information about the cmake-developers mailing list