[CMake] Unreliable Find*.conf

Rolf Eike Beer eike at sf-mail.de
Wed Mar 18 02:59:51 EDT 2015


Am Mittwoch, 18. März 2015, 07:23:12 schrieb Damian Philipp:
> Hello cmake-experts,
> 
> I am working on a project that uses a third-party library delivered in
> binary form (TeamSpeak 3 SDK). My project is supposed to build on Win,
> Linux, and OSX, so I decided to use cmake as a build tool. I have
> started work on a Findts3sdk.cmake (find_package() in module mode) to
> let cmake detect the library in the CMAKE_PREFIX_PATH on any of my
> machines - file attached at the end of this mail.
> 
> My (current) problem is that a call to find_path() in my
> Findts3sdk.cmake will not pick up the bin directory containing the
> libraries, while another call did work to find the include directory.
> 
> WORKS (ts3sdk_INCLUDE_DIR == /path/to/ts3_sdk_3.0.3/include):
> > find_path(ts3sdk_INCLUDE_DIR NAMES clientlib.h HINTS
> > ${CMAKE_PREFIX_PATH}/include)
> BROKEN (ts3sdk_LIBRARY_DIR == ts3sdk_LIBRARY_DIR-NOTFOUND):
> > find_path(ts3sdk_LIBRARY_DIR NAMES libts3client_mac.dylib HINTS
> > ${CMAKE_PREFIX_PATH}/bin)

Use find_library() to find the library itself. If you really need the library 
directory (you probably don't) then use get_filename_component() on the library 
location returned by find_library().

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150318/e58f132b/attachment.sig>


More information about the CMake mailing list