MantisBT - CMake
View Issue Details
0008541CMakeCMakepublic2009-02-16 08:222016-06-10 14:30
Martin Apel 
Bill Hoffman 
normalminoralways
closedmoved 
CMake-2-6 
 
0008541: LINK_FLAGS property interferes with implib option for MSVC linker
When using the LINK_FLAGS property on a target to set additional options for a shared library under Windows, the import library is not generated into the correct place.
The nmake generator generates a wrong link command without any 'implib' directive, which causes the import library to be put into the same directory as the DLL.
Without the LINK_FLAGS property the problem does not occur.
No tags attached.
Issue History
2009-02-16 08:22Martin ApelNew Issue
2009-02-24 10:13Bill HoffmanNote Added: 0015326
2009-02-24 10:14Bill HoffmanStatusnew => assigned
2009-02-24 10:14Bill HoffmanAssigned To => Bill Hoffman
2009-02-25 06:10Martin ApelNote Added: 0015371
2016-06-10 14:27Kitware RobotNote Added: 0041503
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0015326)
Bill Hoffman   
2009-02-24 10:13   
Can you attach an example of this?
(0015371)
Martin Apel   
2009-02-25 06:10   
It's really strange. I tried to reproduce the issue with 2.6.3, but the problem is not exactly the same anymore. The version I used, when I reported the original issue, was 2.6.3RC13.

So this what happens now (which is still a problem with respect to the implib option):

When I link a shared library normally, i.e. a library containing C and C++ source files, CMake generates a link line as this:
        "C:\Programme\CMake 2.6\bin\cmake.exe" -E vs_link_dll C:\PROGRA~1\MICROS~2\VC\bin\link.exe @CMakeFiles\Base.dir\objects1.rsp
       /out:..\run\bin\win32\Base.dll /implib:Base.lib /pdb:E:\ma\new_arch\obj\opt\run\bin\win32\Base.pdb /dll /version:0.0 /MANIFEST /STACK:10000000 /machine:I386 /INCREMENTAL:NO ....

which contains the /implib statement.

One of my libraries consists of Fortran source files and the generated link line looks as follows:
link @CMakeFiles\FortranInterface.dir\objects1.rsp /out:..\run\bin\win32\FortranInterface.dll /dll /MANIFEST /STACK:10000000
/machine:I386 /INCREMENTAL:NO /DEF:FortranInterface.def

The implib statement is not there, no matter what LINK_FLAGS I set. In RC13 the implib statement was only missing if I set the LINK_FLAGS, but was there, if LINK_FLAGS were not set at all. The import library is generated into the directory, where the DLL itself resides, which has been set via CMAKE_RUNTIME_OUTPUT_DIRECTORY.
Sorry if this sounds irritating, but I tried for two hours to reproduce the original problem.

Best Regards,

Martin
(0041503)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.