[CMake] Using gcc as an alternative compiler on windows

Mike Jackson mike.jackson at bluequartz.net
Wed Jan 20 12:51:45 EST 2010


You need to have a valid/correct installation of MinGW or MSYS+MinGW or Cygwin.

After you get one of those installed and working correctly then it is
a matter of telling CMake you want to generate makefiles for one of
those systems.

 So, if you want to use MinGW with the new GCC 4.4 compiler, then get
that installed.
Open up a "MinGW" command prompt
Navigate to a CLEAN build directory and invoke either cmake or cmake-gui

You will want to use the "MinGW Makefiles" generator. CMake will
create the necessary MinGW makefiles for you. Then use
"MinGW-Make32.exe" to build your code.

That is a pretty short "How to" but there are more examples floating
around the internet.

_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Wed, Jan 20, 2010 at 12:35 PM, Chauhan, Vikas
<vikas.chauhan at anritsu.com> wrote:
> Hi,
>
> At present I have written my source code for VS2008. I use cmake to generate
> VS2008 project files.
>
> If I wanted to switch the compiler to gcc then is it possible to use the
> same cmakelists.txt that I have in my source tree & generate the nmake files
> or makefiles or vcproj files to use gcc compiler on windows?
>
> Thanks,
>
> Vikas
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list