Fedora’s packaging guidelines for static libraries are to put them into a separate -static sub-package that is not required by the main -devel sub-package. However this causes problems for most CMake projects because the cmake target expects the static archive to be present event when not using it and you get errors like:
-- HDF5 find comps: C;shared
CMake Error at /usr/lib64/cmake/hdf5/hdf5-targets.cmake:305 (message):
The imported target "hdf5-static" references the file
"/usr/lib64/libhdf5.a"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib64/cmake/hdf5/hdf5-targets.cmake"
but not all the files it references.
Call Stack (most recent call first):
/usr/lib64/cmake/hdf5/hdf5-config.cmake:185 (include)
CMakeLists.txt:286 (find_package)
Anyone? This is a very common issue we face in Fedora packaging. It also comes up when one would want to split a large project up to avoid some dependencies if possible.
Just adding a note that it is import to NOT use -static as the suffix to avoid automatic include from the generated targets file loading the various build types (-release, etc).