FindLIBHQR.cmake 1.19 KB
Newer Older
1 2 3 4 5 6 7 8
# - Try to find LibHQR
# Once done this will define
#  LIBHQR_FOUND - System has LibHQR
#  LIBHQR_INCLUDE_DIRS - The LibHQR include directories
#  LIBHQR_LIBRARIES - The libraries needed to use LibHQR
#  LIBHQR_DEFINITIONS - Compiler switches required for using LIBHQR

find_package(PkgConfig)
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
9 10 11
if(PKG_CONFIG_FOUND)
  pkg_check_modules(PC_LIBHQR QUIET libhqr)
endif()
12 13 14 15

find_path(
  LIBHQR_INCLUDE_DIR
  libhqr.h
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
16 17
  HINTS  ${LIBHQR_DIR} ${PC_LIBHQR_INCLUDEDIR} ${PC_LIBHQR_INCLUDE_DIRS}
  PATH_SUFFIXES include include/libhqr
18 19 20 21 22
  )

find_library(
  LIBHQR_LIBRARY
  NAMES hqr
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
23 24
  HINTS ${LIBHQR_DIR} ${PC_LIBHQR_LIBDIR} ${PC_LIBHQR_LIBRARY_DIRS}
  PATH_SUFFIXES lib lib32 lib64 lib/libhqr lib32/libhqr lib64/libhqr
25 26
  )

BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
27 28 29
set(LIBHQR_DIR "" CACHE PATH "Path where LIBHQR was installed")


30 31 32 33 34
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments
# and set LIBHQR_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
35
  LIBHQR DEFAULT_MSG LIBHQR_LIBRARY LIBHQR_INCLUDE_DIR)
36 37 38 39 40

mark_as_advanced(LIBHQR_INCLUDE_DIR LIBHQR_LIBRARY )

set(LIBHQR_LIBRARIES ${LIBHQR_LIBRARY} )
set(LIBHQR_INCLUDE_DIRS ${LIBHQR_INCLUDE_DIR} )
BOUCHERIE Raphael's avatar
BOUCHERIE Raphael committed
41
set(LIBHQR_DEFINITIONS ${PC_LIBHQR_CFLAGS_OTHER} )