rvaser / spoa

SIMD partial order alignment tool/library
MIT License
158 stars 32 forks source link

CMake fixes #9

Closed SoapZA closed 6 years ago

SoapZA commented 6 years ago

Hi @rvaser this is PR to add pkg-config (in preparation for Meson) which makes dependency querying and general deployment a lot easier. I've also fixed some minor niggles.

rvaser commented 6 years ago

Fancy additions @SoapZA ! Is package(?) GNUInstallDirs always present for inclusion? Also, could you please elaborate why the pkg-config file is needed? Is the BUILD_SHARED_LIBS enabled with -DBUILD_SHARED_LIBS=ON as all the other options? Why are you using @ONLY in configure_file command? The docs say: "If @ONLY is specified, only variables of the form @VAR@ will be replaced and ${VAR} will be ignored", which does not make sense to me here.

SoapZA commented 6 years ago
  1. GNUInstallDirs is unconditionally present since CMake 2.8.5 (hence fine). It doesn't change any of your defaults, it just allows overriding them
  2. pkg-config is an easy and simple way to discover dependencies. Say I want to install Spoa on my system and use it. What if it suddenly requires -lpthread due to some inline functions? What if I require at least version 1.2 due to some feature? Without a way to get this information from the package, the consumer of Spoa has to guess these things and make assumptions, which is bad. pkg-config is extremely common in the wild and most packages provide one (zlib, gtk, Qt, seqan, etc).
  3. correct, -DBUILD_SHARED_LIBS=ON will produce a libspoa.so instead of a libspoa.a. The default stays, namely to produce libspoa.a.
  4. @ONLY is a safety feature. You don't want to erroneously replace pkg-config's variables like ${libdir} which are replaced by pkg-config when it parses the file.
rvaser commented 6 years ago

Thank you for the explanations!