[cmake-developers] [CMake 0015173]: MinGW compiler can NOT be used when also Visual Studio 2013 is installed

Mantis Bug Tracker mantis at public.kitware.com
Sat Sep 27 15:25:24 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15173 
====================================================================== 
Reported By:                Christoph Bastuck
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15173
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   none
Status:                     new
====================================================================== 
Date Submitted:             2014-09-27 15:25 EDT
Last Modified:              2014-09-27 15:25 EDT
====================================================================== 
Summary:                    MinGW compiler can NOT be used when also Visual
Studio 2013 is installed
Description: 
Using Cmake 3.0.2 and compiling my project with MinGW with following command for
Makefile generation:
cmake X:\Projects\Path -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
-DCMAKE_RC_COMPILER=windres -G "MinGW Makefiles"

gcc/g++ is in PATH and cl/link is NOT.

CMake is actually detecting g++/gcc compiler and tries to compile a test sample.
But uses visual studio style compiler flags instead of gcc style, i.e. /DWIN32
instead of -DWIN32. Hence compiling fails. 

Currently there seems possibility to choose MinGW (explicitly). So downgraded to
Cmake 2.8. Here selecting the generator with flag "-G" work as expected.




Steps to Reproduce: 
1. Install MinGW compiler and Visual Studio 2013 on same machine
2. PATH must hold to MingGW compiler
3. remove cl/link from PATH if exists
4. Create MinGW Makefile for your project wirh command:
cmake X:\Projects\Path -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
-DCMAKE_RC_COMPILER=windres -G "MinGW Makefiles"

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-09-27 15:25 Christoph BastuckNew Issue                                    
======================================================================



More information about the cmake-developers mailing list