[CMake] FindLibrary only looks for lib under Windows

David Cole david.cole at kitware.com
Wed Sep 15 07:10:39 EDT 2010


find_library always looks for *.lib files on Windows. Those are the ones
that need to be passed to the linker. The *.dll files are the ones that need
to be there at runtime in order to run correctly.

This behavior is intended, by design, and is working correctly.


HTH,
David

On Tue, Sep 14, 2010 at 10:17 PM, emeplease <emeplease at gmail.com> wrote:

> Hi, I have modified the FindAPR.cmake module to look for the APR library
> under Windows.
>
> Using Find_Library ,
> the library that it should look for is "libapr-1.dll" , however, cmake
> fails to find it. If I change the name from  "libapr-1.dll" to
> "libapr-1.lib" , CMake can successfully locate it.
>
> I am using CMake 2.8 with Visual Studio Express 2008
>
>
> The structure is like
>
> ================================================
>
> IF(WIN32)
> SET(APR_INCLUDE_SEARCH_PATH ${CMAKE_SOURCE_DIR}/ ....
> SET(APR_LIB_SEARCH_PATH ${CMAKE_SOURCE_DIR}/...
> ELSE(WIN32)
> ................................
> ENDIF(WIN32)
>
>
> ================================================
>
> It then looks for the library by
>
> FIND_LIBRARY( APR_LIBRARY NAMES ${APR_NAMES} PATHS ${APR_LIB_SEARCH_PATH} )
>
>
>
>
> Many thanks
> John
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100915/3d0f2136/attachment.htm>


More information about the CMake mailing list