[CMake] builds using mingw with sources on different drive

Brad King brad.king at kitware.com
Tue Mar 29 09:54:42 EDT 2011


On 03/29/2011 02:28 AM, J Decker wrote:
> This ends up building a command line that looks like
> 
> (On c:)
> 
> cd L:\games\spring\cont\base & make_gamedata_arch.bat .......
> 
> since the current drive is the C drive, this doesn't change the drive,
> it only changes the drive on L:, so you'd have to either
> cd L:\games\spring\cont\base & L: & make_gamedata_arch.bat .......
> or
> cd /D L:\games\spring\cont\base & make_gamedata_arch.bat .......

Good catch.  This was previously addressed for the VS generators:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=abaa0267
  http://www.cmake.org/Bug/view.php?id=6150

The fix in this case is in Source/cmLocalUnixMakefileGenerator3.cxx
in the CreateCDCommand method.  Try changing the two appearances of

  cmd = "cd "

in the Windows case to

  cmd = "cd /d "

-Brad


More information about the CMake mailing list