Package: libhiredis-dev
Version: 0.10.1-2

There are no cmake module for this package, so I decided to write one.
Also, I think that placing pkgconfig .pc file with prefix lib is
incorrect - there are no packages doing that except libxml2.
Additionally every pkgconfig module has header containing something like

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

but libhiredis.pc has every variable hardcoded - /usr/lib, /usr/include etc.

So I also attach a fixed hiredis.pc.
p.s. As far as I know, cmake-modules are placed in
/usr/share/cmake-{cmake-version}/Modules, and cmake-version is
different from release to release. Now it's 2.8

Attachment: hiredis.pc
Description: Binary data

# FindHiredis.cmake - Try to find the Hiredis library
# Once done this will define
#
#  HIREDIS_FOUND - System has Hiredis
#  HIREDIS_INCLUDE_DIR - The Hiredis include directory
#  HIREDIS_LIBRARIES - The libraries needed to use Hiredis
#  HIREDIS_DEFINITIONS - Compiler switches required for using Hiredis


# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_RARY() calls
FIND_PACKAGE(PkgConfig)
PKG_SEARCH_MODULE(PC_HIREDIS REQUIRED hiredis)

SET(HIREDIS_DEFINITIONS ${PC_HIREDIS_CFLAGS_OTHER})

FIND_PATH(HIREDIS_INCLUDE_DIR NAMES hiredis/hiredis.h
   HINTS
   ${PC_HIREDIS_INCLUDEDIR}
   ${PC_HIREDIS_INCLUDE_DIRS}
   PATH_SUFFIXES hiredis
   )

FIND_LIBRARY(HIREDIS_LIBRARIES NAMES hiredis
   HINTS
   ${PC_HIREDIS_DIR}
   ${PC_HIREDIS_LIBRARY_DIRS}
   )


INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Hiredis DEFAULT_MSG HIREDIS_LIBRARIES HIREDIS_INCLUDE_DIR)

MARK_AS_ADVANCED(HIREDIS_INCLUDE_DIR HIREDIS_LIBRARIES)

Reply via email to