[CMake] How to build fully correctly versioned shared object files with cmake

Philip Van Hoof philip at codeminded.be
Mon Aug 6 14:27:23 EDT 2018


Hello everyone,

I noticed that it sometimes happens that I find a package for a shared
object file(s) (or DLLs, on platforms like Windows) that have a build
set up using cmake, that doesn't set everything that should be set.

Usually as packagers of various popular open source softwares correct
enthusiasts' attempts at understanding the sometimes bizarre
complexities of for example autotools, but (although it's all less
complicated) also cmake, it ends up somewhat right. Somewhat. I noticed
that especially in corporate world, things tend to go spectacularly
wrong. Almost without exception.

In particular am I concerned about ABI versioning of shared object
files so that they are easy to package and distribute by various
operating systems (like, among others, Linux distributions). But also
API versioning of development files (compiler header files and pkg-
config) and installing to the right installation paths.

I wanted to invite the community to scrutinize some equivalent examples
that I made for autotools (with libtool), qmake, cmake and meson.

https://github.com/pvanhoof/dir-examples/

In particular I wanted to invite the cmake community to take a look at
this example:

https://github.com/pvanhoof/dir-examples/tree/master/cmake-example

The idea is that the examples are as correct as possible. That means
the examples should simple and educational. Easing (some amount) of
platform independence (ie. supporting Windows) and packaging.

ps. I don't think CC-ing a huge amount of mailing lists is necessarily
a good idea. So feel free to forward to the appropriate people.

ps. I attached no license to the examples yet. Perhaps I should attach
one? My goal would be that as much entities could copy and use it.
Including for, indeed, non-free purposes (as much as they want).


Kind regards,

Philip Van Hoof
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://cmake.org/pipermail/cmake/attachments/20180806/c3a98fe8/attachment.sig>


More information about the CMake mailing list