|[paho-dev] Issue compiling Paho C library with SSL and CMake|
I cannot completely understand compilation process of Paho C library. I’ve cloned Git repository and doing a simple ‘make’ I am able to generate the four libraries (c, cs, a, as). That is ok.
The problem comes when I try to do the same process using CMakeLists.txt instead of the default Makefile. I need to do this since I am looking for Paho libraries for ARM architectures. So, I do:
mkdir –p build
cmake -DPAHO_WITH_SSL=TRUE -DOPENSSL_LIB_SEARCH_PATH=/usr/lib/x86_64-linux-gnu -DOPENSSL_INC_SEARCH_PATH=/usr/include/x86_64-linux-gnu/openssl ..
Apparently all works fine, it creates the four libraries but they are not the correct ones. If I focus only in Asynchronous library for example, I can see that:
Default Makefile generates:
- libpaho-mqtt3a.so.1.0 (390K)
- libpaho-mqtt3as.so.1.0 (617K)
Using CMake generates;
- libpaho-mqtt3a.so.1.0.3 (186K)
- libpaho-mqtt3as.so.1.0.3 (186K)
As you could see, using CMake the size of both libraries (with and without SSL) is the same, and both of them have half of the size of the smaller library created by default Makefile.
On the other hand, the version seems to be also different (1.0 vs 1.0.3).
And the most estrange thing is that library generated with CMake work fine without SSL, but of course fails if you try to emply SSL on your connection.
What is the correct way to compile the library using CMake? I am able to compile it (even for different architectures using CMAKE_TOOLCHAIN_FILE variable) but no with SSL support.
A precompiled version of the libraries for ARM architectures will do the trick, but I would like to know how to compile them by my own.
Thanks in advance!
Back to the top