[CMake] Did anyone manage to get incremental linking working with NMake generator?

Bill Hoffman bill.hoffman at kitware.com
Wed Dec 8 12:01:28 EST 2010


On 12/8/2010 10:36 AM, Gabriel Petrovay wrote:
> Hi,
>
> Does anyone have some experience with the NMake generator and with
> incremental linking. There seems to be a bug in CMake. Currently NMake
> generator seems to generate build files that are not compatible with
> incremental linking of libraries.
>
> I posted the details here:
> http://www.cmake.org/pipermail/cmake/2010-December/041181.html
>
> Thanks!
>

That actually should work with CMake, I spent some time making sure it 
would work.

You should see CMake running the link step via cmake -E vs_link_exe. 
That script does this:
-> Link the binary to generate the MyApp.exe.manifest file.
-> Convert the manifest to a resource file.
-> Re-link (incrementally) to embed the manifest resource into the binary."


Linking CXX executable Simple.exe
         "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E vs_link_exe 
C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe  /nologo 
@CMakeFiles\Simple.dir\objects1.rsp @.\nmCC8E.tmp
Visual Studio Incremental Link with embeded manifests
Create Simple.exe.resource.txt
RC Pass 1:
C:/Program Files/Microsoft SDKs/Windows/v6.0A/Bin/RC.Exe 
/foSimple.exe.embed.manifest.res Simple.exe.resource.txt
LINK Pass 1:
C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe /nologo 
@CMakeFiles\Simple.dir\objects1.rsp /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc 
/GR /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /FeSimple.exe 
/FdC:\Users\hoffman\Work\My Builds\CMake\Tests\Simple\b\Simple.pdb -link 
/implib:Simple.lib /version:0.0 /STACK:10000000 /machine:X86 /debug 
/INCREMENTAL:YES /subsystem:console simpleLib.lib kernel32.lib 
user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib 
uuid.lib comdlg32.lib advapi32.lib /MANIFEST 
/MANIFESTFILE:Simple.exe.intermediate.manifest 
Simple.exe.embed.manifest.res
LINK : Simple.exe not found or not built by the last incremental link; 
performing full link
MT:
C:/Program Files/Microsoft SDKs/Windows/v6.0A/Bin/mt.exe /nologo 
/out:Simple.exe.embed.manifest /notify_update /manifest 
Simple.exe.intermediate.manifest
         "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E 
cmake_progress_report "C:\Users\hoffman\Work\My 
Builds\CMake\Tests\Simple\b\CMakeFiles"  1
[100%] Built target Simple
         "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E 
cmake_progress_start "C:\Users\hoffman\Work\My 
Builds\CMake\Tests\Simple\b\CMakeFiles"


-Bill


More information about the CMake mailing list