```cmake
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_search_module(SHARED_HIREDIS REQUIRED hiredis)
endif()

find_path(HIREDIS_INCLUDE_DIR hiredis/hiredis.h
  HINTS ${SHARED_HIREDIS_INCLUDEDIR} ${SHARED_HIREDIS_INCLUDE_DIRS}
  ${LIMIT_SEARCH})

find_library(HIREDIS_LIBRARY NAMES hiredis
  HINTS ${SHARED_HIREDIS_LIBDIR} ${SHARED_HIREDIS_LIBRARY_DIRS}
  ${LIMIT_SEARCH})

mark_as_advanced(HIREDIS_INCLUDE_DIR HIREDIS_LIBRARY)

set(HIREDIS_LIBRARIES ${HIREDIS_LIBRARY})
set(HIREDIS_INCLUDE_DIRS ${HIREDIS_INCLUDE_DIR})
```

Change pkgconfig hiredis library search method
user
```cmake
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_check_modules(SHARED_HIREDIS REQUIRED hiredis)
endif()

find_path(HIREDIS_INCLUDE_DIR hiredis/hiredis.h
  HINTS ${SHARED_HIREDIS_INCLUDEDIR} ${SHARED_HIREDIS_INCLUDE_DIRS}
  ${LIMIT_SEARCH})

find_library(HIREDIS_LIBRARY NAMES hiredis
  HINTS ${SHARED_HIREDIS_LIBDIR} ${SHARED_HIREDIS_LIBRARY_DIRS}
  ${LIMIT_SEARCH})

mark_as_advanced(HIREDIS_INCLUDE_DIR HIREDIS_LIBRARY)

set(HIREDIS_LIBRARIES ${HIREDIS_LIBRARY})
set(HIREDIS_INCLUDE_DIRS ${HIREDIS_INCLUDE_DIR})
```
assistant