From dc8d7fd0e0bd1790b56cb1244ab8ac6f2e6304fe Mon Sep 17 00:00:00 2001
From: patrick96
Date: Mon, 21 Dec 2020 21:47:17 +0100
Subject: [PATCH] Add documentation
---
cmake/common/utils.cmake | 10 ++++++++++
cmake/modules/FindCairoFC.cmake | 9 +++++++++
cmake/modules/FindLibInotify.cmake | 9 +++++++++
cmake/modules/FindLibMPDClient.cmake | 9 +++++++++
cmake/modules/FindLibNlGenl3.cmake | 9 +++++++++
cmake/modules/FindLibPulse.cmake | 9 +++++++++
cmake/modules/FindXcb.cmake | 15 +++++++++++++++
7 files changed, 70 insertions(+)
diff --git a/cmake/common/utils.cmake b/cmake/common/utils.cmake
index b02d5665..f2ce489f 100644
--- a/cmake/common/utils.cmake
+++ b/cmake/common/utils.cmake
@@ -70,6 +70,16 @@ endfunction()
# }}}
# find_package_impl {{{
+# Uses PkgConfig to search for pkg_config_name
+#
+# Defines the following variables:
+# ${find_pkg_name}_FOUND - True if the package has been found
+# ${find_pkg_name}_INCLUDE_DIR - <...>_INCLUDE_DIRS exported by pkg_check_modules
+# ${find_pkg_name}_INCLUDE_DIRS - Same as ${find_pkg_name}_INCLUDE_DIR
+# ${find_pkg_name}_LIBRARY - <...>_LIBRARIES exported by pkg_check_modules
+# ${find_pkg_name}_LIBRARIES - Same as ${find_pkg_name}_LIBRARY
+# ${find_pkg_name}_VERSION - <...>_VERSION exported by pkg_check_modules
+#
macro(find_package_impl pkg_config_name find_pkg_name header_to_find)
find_package(PkgConfig REQUIRED)
include(FindPackageHandleStandardArgs)
diff --git a/cmake/modules/FindCairoFC.cmake b/cmake/modules/FindCairoFC.cmake
index febbe52e..a6928e35 100644
--- a/cmake/modules/FindCairoFC.cmake
+++ b/cmake/modules/FindCairoFC.cmake
@@ -1,3 +1,12 @@
+# This module defines an imported target `Cairo::CairoFC` if cairo-fc is found
+#
+# Defines the following Variables (see find_package_impl for more info):
+# CairoFC_FOUND
+# CairoFC_INCLUDE_DIR
+# CairoFC_INCLUDE_DIRS
+# CairoFC_LIBRARY
+# CairoFC_LIBRARIES
+# CairoFC_VERSION
find_package_impl("cairo-fc" "CairoFC" "")
if(CairoFC_FOUND AND NOT TARGET Cairo::CairoFC)
diff --git a/cmake/modules/FindLibInotify.cmake b/cmake/modules/FindLibInotify.cmake
index 8434914d..9c61d118 100644
--- a/cmake/modules/FindLibInotify.cmake
+++ b/cmake/modules/FindLibInotify.cmake
@@ -1,3 +1,12 @@
+# This module defines an imported target `LibInotify::LibInotify` if libinotify is found
+#
+# Defines the following Variables (see find_package_impl for more info):
+# LibInotify_FOUND
+# LibInotify_INCLUDE_DIR
+# LibInotify_INCLUDE_DIRS
+# LibInotify_LIBRARY
+# LibInotify_LIBRARIES
+# LibInotify_VERSION
find_package_impl("libinotify" "LibInotify" "")
if(LibInotify_FOUND AND NOT TARGET LibInotify::LibInotify)
diff --git a/cmake/modules/FindLibMPDClient.cmake b/cmake/modules/FindLibMPDClient.cmake
index a4e430bb..7a75520f 100644
--- a/cmake/modules/FindLibMPDClient.cmake
+++ b/cmake/modules/FindLibMPDClient.cmake
@@ -1,3 +1,12 @@
+# This module defines an imported target `LibMPDClient::LibMPDClient` if libmpdclient is found
+#
+# Defines the following Variables (see find_package_impl for more info):
+# LibMPDClient_FOUND
+# LibMPDClient_INCLUDE_DIR
+# LibMPDClient_INCLUDE_DIRS
+# LibMPDClient_LIBRARY
+# LibMPDClient_LIBRARIES
+# LibMPDClient_VERSION
find_package_impl("libmpdclient" "LibMPDClient" "mpd/player.h")
if(LibMPDClient_FOUND AND NOT TARGET LibMPDClient::LibMPDClient)
diff --git a/cmake/modules/FindLibNlGenl3.cmake b/cmake/modules/FindLibNlGenl3.cmake
index 879399f5..bca029cf 100644
--- a/cmake/modules/FindLibNlGenl3.cmake
+++ b/cmake/modules/FindLibNlGenl3.cmake
@@ -1,3 +1,12 @@
+# This module defines an imported target `LibNlGenl3::LibNlGenl3` if libnl-genl-3.0 is found
+#
+# Defines the following Variables (see find_package_impl for more info):
+# LibNlGenl3_FOUND
+# LibNlGenl3_INCLUDE_DIR
+# LibNlGenl3_INCLUDE_DIRS
+# LibNlGenl3_LIBRARY
+# LibNlGenl3_LIBRARIES
+# LibNlGenl3_VERSION
find_package_impl("libnl-genl-3.0" "LibNlGenl3" "")
if(LibNlGenl3_FOUND AND NOT TARGET LibNlGenl3::LibNlGenl3)
diff --git a/cmake/modules/FindLibPulse.cmake b/cmake/modules/FindLibPulse.cmake
index 7a84604d..bbd307da 100644
--- a/cmake/modules/FindLibPulse.cmake
+++ b/cmake/modules/FindLibPulse.cmake
@@ -1,3 +1,12 @@
+# This module defines an imported target `LibPulse::LibPulse` if libpulse is found
+#
+# Defines the following Variables (see find_package_impl for more info):
+# LibPulse_FOUND
+# LibPulse_INCLUDE_DIR
+# LibPulse_INCLUDE_DIRS
+# LibPulse_LIBRARY
+# LibPulse_LIBRARIES
+# LibPulse_VERSION
find_package_impl("libpulse" "LibPulse" "pulse/version.h")
if(LibPulse_FOUND AND NOT TARGET LibPulse::LibPulse)
diff --git a/cmake/modules/FindXcb.cmake b/cmake/modules/FindXcb.cmake
index 1679c309..8ebf1aef 100644
--- a/cmake/modules/FindXcb.cmake
+++ b/cmake/modules/FindXcb.cmake
@@ -1,3 +1,18 @@
+# Loads multiple XCB components
+# Version checks will be made against all requested components
+#
+# For each component ${comp} it does the following:
+#
+# Defines an imported target `Xcb::${comp}` if xcb-${comp} is found
+#
+# Defines the following Variables (see find_package_impl for more info):
+# Xcb_${comp}_FOUND
+# Xcb_${comp}_INCLUDE_DIR
+# Xcb_${comp}_INCLUDE_DIRS
+# Xcb_${comp}_LIBRARY
+# Xcb_${comp}_LIBRARIES
+# Xcb_${comp}_VERSION
+
# This script only supports the following components of XCB
set(XCB_known_components
XCB