From b3d195f0188758a14875a5a2f270e4fd190a679f Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 17 Apr 2018 00:15:38 +0200 Subject: sync with upstream --- cmake/modules/FindLircClient.cmake | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cmake/modules/FindLircClient.cmake (limited to 'cmake/modules/FindLircClient.cmake') diff --git a/cmake/modules/FindLircClient.cmake b/cmake/modules/FindLircClient.cmake new file mode 100644 index 0000000..528c38e --- /dev/null +++ b/cmake/modules/FindLircClient.cmake @@ -0,0 +1,36 @@ +# FindLircClient +# ----------- +# Finds the liblirc_client library +# +# This will will define the following variables:: +# +# LIRCCLIENT_FOUND - if false, do not try to link to lirc_client +# LIRCCLIENT_INCLUDE_DIRS - where to find lirc/lirc_client.h +# LIRCCLIENT_LIBRARYS - the library to link against +# LIRCCLIENT_DEFINITIONS - the lirc definitions + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_LIRC lirc QUIET) +endif() + +find_path(LIRCCLIENT_INCLUDE_DIR lirc/lirc_client.h PATHS ${PC_LIRC_INCLUDEDIR}) +find_library(LIRCCLIENT_LIBRARY lirc_client PATHS ${PC_LIRC_LIBDIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LircClient + REQUIRED_VARS LIRCCLIENT_LIBRARY LIRCCLIENT_INCLUDE_DIR) + +if(LIRCCLIENT_FOUND) + set(LIRCCLIENT_LIBRARIES ${LIRCCLIENT_LIBRARY}) + set(LIRCCLIENT_INCLUDE_DIRS ${LIRCCLIENT_INCLUDE_DIR}) + set(LIRCCLIENT_DEFINITIONS -DHAS_LIRC=1) + + if(NOT TARGET LIRCCLIENT::LIRCCLIENT) + add_library(LIRCCLIENT::LIRCCLIENT UNKNOWN IMPORTED) + set_target_properties(LIRCCLIENT::LIRCCLIENT PROPERTIES + IMPORTED_LOCATION "${LIRCCLIENT_LIBRARYS}" + INTERFACE_INCLUDE_DIRECTORIES "${LIRCCLIENT_INCLUDE_DIRS}") + endif() +endif() + +mark_as_advanced(LIRCCLIENT_LIBRARY LIRCCLIENT_INCLUDE_DIR) \ No newline at end of file -- cgit v1.2.3