Link MariaDB Client Library for C with specific external zlib and openssl

Hi,

I am trying to link the mariadb client library with zlib and openssl which are neither embedded in mariadb (for zlib), nor the one available on the system: I want to force cmake to use zlib and openssl from a given path.

How can I do that? Is there another way than creating my own FindZLIB.cmake and force it via CMAKE_MODULE_PATH ?

Thank you.

Answer

I'm not quite sure what are you doing — building mariadb client library or your own application, that uses cmake and mariadb client library. But anyway, you can specify compiler and linker flags like the following:

cmake -DCMAKE_C_FLAGS=-I/path/to/zlib/includes \
      -DCMAKE_EXE_LINKER_FLAGS=-L/path/to/zlib/library

You might need to use CMAKE_SHARED_LINKER_FLAGS instead of CMAKE_EXE_LINKER_FLAGS, depending on what you're building.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.