summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-06-16 16:32:45 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-06-16 16:32:45 +0200
commit03a45db7f3905ba834e4a0690b70936bd37b2633 (patch)
tree38ed54b3771dd3c205e3658eacf722467d326b01 /cmake
downloaduca-ufo-03a45db7f3905ba834e4a0690b70936bd37b2633.tar.gz
uca-ufo-03a45db7f3905ba834e4a0690b70936bd37b2633.tar.bz2
uca-ufo-03a45db7f3905ba834e4a0690b70936bd37b2633.tar.xz
uca-ufo-03a45db7f3905ba834e4a0690b70936bd37b2633.zip
Initial commit
For the past plugin history refer to the libuca repository.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindIPE.cmake19
-rw-r--r--cmake/PkgConfigVars.cmake30
2 files changed, 49 insertions, 0 deletions
diff --git a/cmake/FindIPE.cmake b/cmake/FindIPE.cmake
new file mode 100644
index 0000000..11e8d90
--- /dev/null
+++ b/cmake/FindIPE.cmake
@@ -0,0 +1,19 @@
+# Try to find user-space driver for the IPE camera
+#
+# Defines
+#
+# IPE_FOUND - system has libpcidriver
+# IPE_INCLUDE_DIRS - libpci include directory
+# IPE_LIBRARIES - pci library
+
+find_package(PackageHandleStandardArgs)
+
+find_path(IPE_INCLUDE_DIRS pcilib.h)
+find_library(IPE_LIBRARIES pcilib)
+
+find_package_handle_standard_args(IPE DEFAULT_MSG IPE_LIBRARIES IPE_INCLUDE_DIRS)
+
+mark_as_advanced(
+ IPE_INCLUDE_DIRS
+ IPE_LIBRARIES
+)
diff --git a/cmake/PkgConfigVars.cmake b/cmake/PkgConfigVars.cmake
new file mode 100644
index 0000000..f295457
--- /dev/null
+++ b/cmake/PkgConfigVars.cmake
@@ -0,0 +1,30 @@
+# - determine variables defined in pkg-config files
+#
+# Usage:
+# pkg_check_variable(<PKG_NAME> <VARIABLE_NAME>)
+#
+# Checks for a variable in the given package and translates to a call such as
+# `pkg-config --variable=<VARIABLE_NAME> <PKG_NAME>`. The output is a cached
+# variable named
+#
+# <PKG_NAME>_<VARIABLE_NAME>
+#
+# Note that both names are uppercased and any dashes replaced by underscores.
+#
+
+find_package(PkgConfig REQUIRED)
+
+function(pkg_check_variable _pkg _name)
+ string(TOUPPER ${_pkg} _pkg_upper)
+ string(TOUPPER ${_name} _name_upper)
+ string(REPLACE "-" "_" _pkg_upper ${_pkg_upper})
+ string(REPLACE "-" "_" _name_upper ${_name_upper})
+ set(_output_name "${_pkg_upper}_${_name_upper}")
+
+ execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_name} ${_pkg}
+ OUTPUT_VARIABLE _pkg_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ set("${_output_name}" "${_pkg_result}" CACHE STRING "pkg-config variable
+ ${_name} of ${_pkg}")
+endfunction()