[CMake] Running NMake from a Cygwin Bash shell... is it possible?

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Aug 6 10:02:37 EDT 2007


Hi Miguel,

  I do that all the time. You only need to modify PATH to work on
cyginw (ie. replace the ; with :). You should NOT change LIB or
INCLUDE, those variable are read by cl/link thus should contains ; as
separators

HTH
-Mathieu

On 8/6/07, Miguel A. Figueroa-Villanueva <miguelf at ieee.org> wrote:
> Hello everyone,
>
> Does anyone generate NMake makefiles and spawns the build from a
> cygwin bash shell. If I generate Visual Studio 8 project files, then I
> can use the following:
>
> devenv8.com CMake.sln /build Release /project ALL_BUILD
>
> from cygwin bash shell with no problems. But I can't manage to launch
> the nmake makefiles from it. I can do it from a Dos shell, but not
> bash. I do set the variables found in the vsvars32.bat as shown below.
> I couldn't use the windows cmake to generate the NMake Makefiles, so I
> tried generating the files from a Dos shell and then just using nmake
> in the cygwin bash shell, but that didn't work either (ouput below).
>
> So, my question is.... does anybody manage to work this out or are the
> tools just not compatible?
>
> Thanks,
> --Miguel
>
> ------------------- Start: Environment Settings ---------------------------
> export VSINSTALLDIR="/c/Program Files/Microsoft Visual Studio 8"
> export VCINSTALLDIR="${VSINSTALLDIR}/VC"
> export FrameworkDir="/c/WINDOWS/Microsoft.NET/Framework"
> export FrameworkSDKDir="${VSINSTALLDIR}/SDK/v2.0"
> export FrameworkVersion="v2.0.50727"
> export DevEnvDir="${VSINSTALLDIR}/Common7/IDE"
> export PATH="${DevEnvDir}:${VCINSTALLDIR}/BIN:${VSINSTALLDIR}/Common7/Tools:${VSINSTALLDIR}/Common7/Tools/bin:${VCINSTALLDIR}/PlatformSDK/bin:${FrameworkSDKDir}/bin:${FrameworkDir}/${FrameworkVersion}:${VCINSTALLDIR}/VCPackages:${PATH}"
> export INCLUDE="${VCINSTALLDIR}/atlmfc/INCLUDE:${VCINSTALLDIR}/INCLUDE:${VCINSTALLDIR}/PlatformSDK/include:${FrameworkSDKDir}/include"
> export LIB="${VCINSTALLDIR}/atlmfc/LIB:${VCINSTALLDIR}/lib:${VCINSTALLDIR}/PlatformSDK/lib:${FrameworkSDKDir}/Lib"
> export LIBPATH="${FrameworkDir}/${FrameworkVersion}:${VCINSTALLDIR}/ATLMFC/LIB"
> ------------------- End: Environment Settings ---------------------------
>
> ------------------- Start: NMake output ---------------------------
> $ nmake
>
> Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
>         D:\eclipse\cmake_mingw\bin\cmake.exe -HD:\eclipse\CMake
> -BD:\eclipse\cmake_nmake --check-build-system
> CMakeFiles\Makefile.cmake 0
>         D:\eclipse\cmake_mingw\bin\cmake.exe -E cmake_progress_start
> D:\eclipse\cmake_nmake\CMakeFiles 100
>         "c:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"
> -f CMakeFiles\Makefile2 /nologo -                   all
>         "c:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"
> -f Source\kwsys\CMakeFiles\cmsysEncodeExecutable.dir\build.make
> /nologo -L
> Source\kwsys\CMakeFiles\cmsysEncodeExecutable.dir\depend
>         "c:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"
> -f Source\kwsys\CMakeFiles\cmsysEncodeExecutable.dir\build.make
> /nologo -L
> Source\kwsys\CMakeFiles\cmsysEncodeExecutable.dir\build
>         D:\eclipse\cmake_mingw\bin\cmake.exe -E cmake_progress_report
> D:\eclipse\cmake_nmake\CMakeFiles
> [  0%] Building C object
> Source/kwsys/CMakeFiles/cmsysEncodeExecutable.dir/EncodeExecutable.obj
>         C:\PROGRA~1\MICROS~4\VC\bin\cl.exe
> @c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nm550C.tmp
> EncodeExecutable.c
> D:\eclipse\CMake\Source\kwsys\EncodeExecutable.c(14) : fatal error
> C1083: Cannot open include file: 'stdio.h': Invalid argument
> NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~4\VC\bin\cl.exe' :
> return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio
> 8\VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio
> 8\VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
> ------------------- End: NMake output ---------------------------
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


-- 
Mathieu


More information about the CMake mailing list