From: Manuel Nickschas Date: Sun, 23 Mar 2014 01:15:12 +0000 (+0100) Subject: Add a CMake wrapper for finding indicate-qt X-Git-Tag: 0.11.0~96 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=61124ace4a9a9356a619cc2f26b96f6c710c514c Add a CMake wrapper for finding indicate-qt Because CMake's feature_summary works only with dependencies found via find_package, it makes sense to have a wrapper around the PkgConfig call used to find indicate-qt. This is very basic and does not support all of the usual options (such as checking for a particular version), but sufficient for our needs. --- diff --git a/cmake/FindIndicateQt.cmake b/cmake/FindIndicateQt.cmake new file mode 100644 index 00000000..5279c06d --- /dev/null +++ b/cmake/FindIndicateQt.cmake @@ -0,0 +1,28 @@ +# CMake wrapper for finding indicate-qt +# This is not very flexible (e.g. no version check), but allows using +# a normal find_package call and thus support for feature_summary +# +# (C) 2014 by the Quassel Project +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +# Once found, sets the standard set of variables: +# INDICATEQT_FOUND - IndicateQt available in the system +# INDICATEQT_LIBRARIES - Libraries to link with +# INDICATEQT_INCLUDE_DIRS - Include directories containing the headers +# +############################################################################## + +include(FindPackageHandleStandardArgs) + +if (USE_QT4) + # requires PkgConfig for now; patches for finding it directly welcome! + find_package(PkgConfig QUIET) + if (PKG_CONFIG_FOUND) + pkg_check_modules(INDICATEQT QUIET indicate-qt>=0.2.1) + endif() +endif() + +find_package_handle_standard_args(IndicateQt DEFAULT_MSG INDICATEQT_LIBRARIES INDICATEQT_INCLUDE_DIRS) +mark_as_advanced(INDICATEQT_LIBRARIES INDICATEQT_INCLUDE_DIRS)