thanks for the tips so far and I can link external libs with e.g. libsql.a but the problem seems to go deeper and the core issue appears to be -

linking a static library to say libsql.a breaks generation of libmysqld.a as Linux ar/ranlib can not strip out nested linked libraries.

This is somewhat of a limitation and would cause quite some rewrite of things ready for integration (into libsql). Ouch.

Rob


On Mon, Aug 19, 2013 at 8:13 PM, Vladislav Vaintroub <wlad@montyprogram.com> wrote:

TARGET_LINK_LIBRARIES({$LIBNAME}) is not a correct syntax

 

It does need target (you link your library to some other library or executable, and this library or executable is called target)

 

TARGET_LINK_LIBRARIES(<target> “${LIBNAME}”) should work

 

For example, if you want to link something with mysqld, you add to CMakeLists.txt

TARGET_LINK_LIBRARIES(mysqld “${LIBNAME}”)

 

 

From: Maria-developers [mailto:maria-developers-bounces+wlad=montyprogram.com@lists.launchpad.net] On Behalf Of rg
Sent: Montag, 19. August 2013 01:53
To: maria-developers@lists.launchpad.net
Subject: [Maria-developers] linking an external library

 

Folks,

I want to link an external library for a language extension. After several hours of trying to tell cmake (^%$@*&) to pick it up for linking the library would still not be built with.

CMakeLists.txt in trunk/sql is in the meantime full of pointers to the library without avail.

I did the normal FIND_LIBRARY()

followed by TARGET_LINK_LIBRARIES({$LIBNAME}) on various targets

plus as nothing worked: SET(CMAKE_LIBRARY_PATH) on it, explicity LINK_DIRECTORIES(), SET(CMAKE_PREFIX_PATH), SET(CMAKE_LIBRARY_PATH) ...

How do I link mariadb with an external library??

Thanks Rob