1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-27 05:23:39 -04:00
polybar/cmake/modules/FindLibMPDClient.cmake
2020-12-22 00:37:07 +01:00

22 lines
741 B
CMake

find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_LibMPDClient QUIET libmpdclient)
include(FindPackageHandleStandardArgs)
find_path(LibMPDClient_INCLUDES
NAMES mpd/player.h
HINTS ${PC_LibMPDClient_INCLUDEDIR} ${PC_LibMPDClient_INCLUDE_DIRS}
)
find_package_handle_standard_args(LibMPDClient
REQUIRED_VARS LibMPDClient_INCLUDES
VERSION_VAR PC_LibMPDClient_VERSION
)
if(LibMPDClient_FOUND AND NOT TARGET LibMPDClient::LibMPDClient)
add_library(LibMPDClient::LibMPDClient INTERFACE IMPORTED)
set_target_properties(LibMPDClient::LibMPDClient PROPERTIES
INTERFACE_LINK_LIBRARIES "${PC_LibMPDClient_LIBRARIES}")
target_include_directories(LibMPDClient::LibMPDClient SYSTEM INTERFACE ${LibMPDClient_INCLUDES})
endif()