[CMake] Import libraries prefix bug under windows?

Brandon Van Every bvanevery at gmail.com
Tue Nov 6 19:12:35 EST 2007


Please provide a reproducer script so others of us can test your claim.

Cheers,
Brandon Van Every

On Nov 6, 2007 6:04 PM, Ronan Collobert <collober at nec-labs.com> wrote:
> Hi,
>
>    I have been using CMake for quite a while now under
> Linux/MacOSX/Cygwin for a large project.
>
> Recently I have been trying to make it work under Windows, using the
> freely available to download Windows SDK. (cmake -G "NMake Makefiles")
>
> I encountered a small problem, which might be a CMake bug. (I am using
> the latest cmake 2.4.7)
>
> I ask CMake to produce a dll (let say foo.dll), and then I want to link
> this dll to produce an executable bar.exe.
>
> I also changed the prefixes of the dll using:
>   SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
>   SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
>
> So in fact, the dll generated is libfoo.dll (which is right). An import
> library is also generated (libfoo.lib) (which is still right).
>
> But then when the makefile generated by CMake wants to link and produce
> bar.exe, the linker complains that it did not find "foo.lib". It seems
> it completely ignore the given prefix of the dll here.
>
> Moving "libfoo.lib" to "foo.lib" and resuming the compilation works.
> Not having a prefix also works.
> So I would say it is a bug.
>
> In fact, I am not sure at all of this CMAKE_IMPORT_LIBRARY_PREFIX:
> whatever I put there is ignored for the production of libfoo.lib (it is
> always libfoo.lib which is produced, according to what it is given by
> CMAKE_SHARED_LIBRARY_PREFIX)
>
> Ronan.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list