On 2021-01-23 Markus Rickert wrote:
> This could be solved by adding an alias to the config file:
> add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma)
>
> An additional improvement would be to enable this on case-sensitive
> file systems as well. For this, the config file would need to be
> renamed from liblzmaConfig.cmake to liblzma-config.cmake (and the
> version file to liblzma-config-version.cmake), see [2].
I have committed both of your suggestions (hopefully correctly). Thanks!
Some extra thoughts: There are some differences between FindLibLZMA and
the config file:
- FindLibLZMA doesn't #define LZMA_API_STATIC when building against
static liblzma. LZMA_API_STATIC omits __declspec(dllimport) from
liblzma function declarations on Windows.
- FindLibLZMA sets a few CMake cache variables that the config file
doesn't, for example, LIBLZMA_HAS_EASY_ENCODER. I have no idea if
there are packages that care about this.
- The config file has find_dependency(Threads) while FindLibLZMA
doesn't. This can affect the linker flags.
Perhaps there are other details affecting compatiblity. I just wonder
how big mistake it was to use liblzma::liblzma in the config file. I
guess it's too late to change it now.
--
Lasse Collin | IRC: Larhzu @ IRCnet & Freenode