[CMake] cmake 2.6 and find_library with MinGW generator

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Wed May 21 10:07:00 EDT 2008


> Von: Bill Hoffman
> Christian Ehrlicher wrote:
> > Hi,
> > 
> > during your new warning when mixing libs in target_link_libraries 
> > (CMP0003) I changed target_link_libraries(foo ws2_32) to
> > 
> > find_library(WS2_32_LIBRARY ws2_32)
> > target_link_libraries(foo ${WS2_32_LIBRARY})
> > 
> > but now cmake finds ws2_32.dll in system32 instead the correct one 
> > (ws2_32.dll.a / ws2_32.a) in mingw dir.
> > 
> 
> 
> AHHHH!!!
> 
> This is the most misunderstood warning of all times....  :)
> 
> 
> You do not have to use full paths for all libraries now.
> You do not have to use full paths for all libraries now.
> 
> For system libraries like this one it is much safer to just list them. 
> If you set the policy to NEW, it will just work with no warnings. The 
> warning says that it maybe a problem, but to try it as NEW, and if it is 
> not a problem, then you are good.
> 
> For this case I would recommend changing ws2_32 to not being found.  It 
> is a standard library that the compiler should be able to find the 
> appropriate version of.
> 
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.


Christian

-- 
Desperate Housewives - das Spiel!
Pikante Skandale, schockierende Details unter: http://flat.games.gmx.de


More information about the CMake mailing list