View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002509CMakeCMakepublic2005-11-20 19:582006-01-02 12:38
ReporterAlvaro 
Assigned ToBill Hoffman 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002509: Add support for mingw32-make
DescriptionCMake badly supports Windows ports of gcc such as MinGW. The target "Unix Makefiles" makes files which include unix and sh conventions like / as directory separator and \ to escape spaces. The standard Windows shell does not understand that syntax, and CMake fails when it tries to run a command whose path includes spaces:
C:/Program\ Files/CMake 2.2/whatever.exe => fails saying "C:/Program" not found.

One fix is to install a Unix emulation package (e.g. MSYS) but it should not be necessary IMHO.
A workaround is to move CMake to a directory without spaces (e.g. C:\cmake)

Spaces in the source and destination paths for CMake projects might also be a problem but have not been tested.

This problem should be fixed so that using CMake with MinGW or Cygwin is possible and simple. The way to escape paths with spaces in Windows is to write them in double quotes:

"C:\Program Files\CMake 2.2\whatever.exe" <= OK

Even if they are Unix Makefiles, if they live in Windows they should respect some rules, shouldn't they? :-)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0003280)
Alvaro (reporter)
2005-11-20 20:07

Oops! The system has removed the backslashes I wrote! That makes parts of the report nonsense.

FYI, I talked about the Unix shell convention of using a backslash to escape spaces in paths, which does not work on the Windows shell.

The quoted string near the end had 3 backslashes (Replaced with forward slashes here):
"C:/Program Files/CMake 2.2/whatever.exe" <= OK
(0003281)

2005-11-20 22:03

Many people are using cygwin and MinGW with cmake, in fact we test those each night:
http://public.kitware.com/dashboard.php?name=cmake [^]

However, we do use unix paths, as gmake, and gcc understand unix paths. I just tried running cygwin gmake from a dos shell and it worked fine???

What make are you using? I think with gmake there is an option to use unix paths or not. BTW, IF we changed it to quoted paths, then it would not work from cygwin or msys shells.

I think I remember something about gmake having a dos and a unix mode, I think it was controlled by an environment variable.
(0003282)
Bill Hoffman (manager)
2005-11-20 22:05

CMake is tested nightly with mingw and cygwin. See the testing dashboard www.cmake.org.

We usually use msys shell or cygwin shell. However, I just tried building with gcc and gmake from a dos shell and it worked fine. gmake should know how to do unix style paths. What make program are you using?
I seem to remember gmake using some env variable to put it in unix or dos mode. BTW, double quoted paths will not work from an msys or a cygwin shell....

(0003286)
Alvaro (reporter)
2005-11-21 04:48

Updated info:

First problem comes if CMakeSetup is run from the Start menu. Configure fails with a DuplicateHandle(In) error (invalid handle). If CMakeSetup is run from a console that error is avoided.

Next, the Configure process starts quite well, and after a few successful calls to gmake (entering subdirectories, and so on), it fails when trying "Scanning dependencies of target cmTryCompileExec. The bad command is:

E:/Archivos\\ de\\ programa/CMake\\ 2.2/bin/cmake.exe -E cmake_depends "Unix Makefiles" <rest stripped>

And the error is:

"E:/Archivos\\" not recongnized as an internal or external command. (this is given by the Windows shell)

Then:

make (mingw32-make.exe) does understand Unix paths and escape chars, but at some point it passes one of those paths to the shell for execution unconverted, and that is not understood. The first space is treated as an argument separator.
(0003293)
Bill Hoffman (manager)
2005-11-22 12:01

I am changing this to a feature request. Currently cmake supports make.exe from msys. A google search reveals that many projects require folks to do this:
"Move /mingw/bin/make.exe to /mingw/bin/mingw32-make.exe as directed."

Currently, the CMake supported way of using mingw is to run CMakeSetup from an Msys shell.

(0003488)
Bill Hoffman (manager)
2006-01-02 12:38

This is fixed in cvs, just use the "MinGW Makefiles" generator from CMakeSetup.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team