[CMake] cmake 2.6 and find_library with MinGW generator
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Wed May 21 10:51:09 EDT 2008
Bill Hoffman schrieb:
> Christian Ehrlicher wrote:
>
>>>
>> I understood the warning - I know that it is not mandatory.
> > But how useful is a warning when the only way to get rid of them is
> >
>> to disable it? I either have to fix all places (including the system libs
> >) or disable it and don't care at all. That's stupid.
>>
>
> OK, so you don't understand the warning. Not your fault it is just hard
> to write as many others do not understand it.
>
> Here is the problem:
>
> We changed from -L/path/to -lA to /path/to/library. In some rare cases
> projects have something like this:
>
> target_link_libraries(foo /path/to/libA.a B)
>
> And B is actually in /path/to/libB.a
>
> We have no easy way of telling the difference between the above and
>
> target_link_libraries(foo /path/to/libA.a somesystemlib)
>
> Where somesystemlib library can be found by the compiler.
>
> So, we had two choices for 2.6:
>
> 1. Always add -L/path if there is at least one non-full path library
> linked in. This makes extra long link lines.
>
> 2. Do not add -L/path and give no warning - we will break some projects
> with no warning, and the break will happen with a linker error during
> the build step.
>
> So, what we did was do 1 by default, but give a warning.
>
> So, to make a long story short, setting the policy to NEW is not
> "disabling" the warning, it is asking CMake to link libraries in the new
> better 2.6 way. So, the correct fix is to set the policy to NEW, and if
> your stuff links then the warning was in error. If a project has 2.6 as
> the minimum require version there is no warning and things are always
> linked full path.
>
Thx for the explanation.
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080521/f38c685d/attachment.pgp>
More information about the CMake
mailing list