1 # - Try to find LibXKlavier
2 # Once done this will define
4 # LIBXKLAVIER_FOUND - system has LibXKlavier
5 # LIBXKLAVIER_LIBRARIES - the libraries needed to use LibXKlavier
6 # LIBXKLAVIER_DEFINITIONS - Compiler switches required for using LibXKlavier
8 if (LIBXKLAVIER_DEFINITIONS AND LIBXKLAVIER_LIBRARIES)
11 SET(LIBXKLAVIER_FOUND TRUE)
13 else (LIBXKLAVIER_DEFINITIONS AND LIBXKLAVIER_LIBRARIES)
16 # use pkg-config to get the directories and then use these values
17 # in the FIND_PATH() and FIND_LIBRARY() calls
19 PKGCONFIG(libxklavier _LibXKlavierIncDir _LibXKlavierLinkDir _LibXKlavierLinkFlags _LibXKlavierCflags)
21 if(_LibXKlavierLinkFlags)
22 # find again pkg-config, to query it about libxklavier version
23 FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config )
25 # query pkg-config asking for a libxklavier >= 3.0
26 EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=3.0 libxklavier RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
27 if(_return_VALUE STREQUAL "0")
28 set(LIBXKLAVIER_DEFINITIONS ${_LibXKlavierCflags})
29 endif(_return_VALUE STREQUAL "0")
30 endif(_LibXKlavierLinkFlags)
34 # FIND_PATH(LIBXKLAVIER_INCLUDE_DIR libxklavier/xklavier.h
36 # ${_LibXKlavierIncDir}
37 # PATH_SUFFIXES libxklavier
40 FIND_LIBRARY(LIBXKLAVIER_LIBRARIES NAMES xklavier libxklavier
42 ${_LibXKlavierLinkDir}
45 include(FindPackageHandleStandardArgs)
46 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXKlavier DEFAULT_MSG LIBXKLAVIER_DEFINITIONS LIBXKLAVIER_LIBRARIES )
48 MARK_AS_ADVANCED(LIBXKLAVIER_DEFINITIONS LIBXKLAVIER_LIBRARIES)
50 endif (LIBXKLAVIER_DEFINITIONS AND LIBXKLAVIER_LIBRARIES)