[CMake] Using mingw from cygwin terminal (/cygwin directory problems)

Mike McQuaid mike at mikemcquaid.com
Tue Aug 31 03:30:13 EDT 2010


On 30 Aug 2010, at 20:14, Tam Toucan wrote:

> Hi,
>   I've just started converting my projects from autotools to CMake and I've hit a simple problem. I want to compile from a cygwin terminal, but using mingw32 (cygwin gcc has removed the -mno-cygwin option). I'm using
> 
> SET(CMAKE_CXX_COMPILER "mingw32-g++")
> FILE(GLOB foo_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.C)
> ADD_LIBRARY(foo STATIC ${foo_SOURCES})
> 
> but that tries to compile the source at an absolute path of
> 
>   /home/Tam/src/foo.C
> 
> but mingw can't see that directory since from a windows point of view the source is
> 
>    /cygwin/home/Tam/src/foo.C
> 
> how should I be doing this? I thought I'd just try it from a Windoze command window (just to see if I could get it working, but I really don't want to have to use it), but when I run cmake is still picks up /usr/bin/c++.exe at the default and tries to compile using /home for all the paths.

To do this you need to use a version of CMake compiled in Cygwin. I'm pretty sure a binary package is available in the package manager.

--
Cheers,
Mike McQuaid
http://mikemcquaid.com



More information about the CMake mailing list