summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAdam Horden <adam.horden@horden.engineering>2021-02-22 22:22:40 +0000
committermormj <34754695+mormj@users.noreply.github.com>2021-06-04 06:21:34 -0400
commit6d3965f79d671afbb0b688620f3b4b218e02a352 (patch)
tree83a38f0c1795616509f4f7896da4f82e0ebce3e5 /cmake
parent885f9587d22e5f294e1012be56402601831d369a (diff)
feature: gr-iio
Co-authored-by: Edward Kigwana <ekigwana@scires.com> Co-authored-by: Travis Collins <travis.collins@analog.com> Signed-off-by: Adam Horden <adam.horden@horden.engineering>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindAD9361.cmake52
-rw-r--r--cmake/Modules/FindIIO.cmake52
2 files changed, 104 insertions, 0 deletions
diff --git a/cmake/Modules/FindAD9361.cmake b/cmake/Modules/FindAD9361.cmake
new file mode 100644
index 0000000000..b17798c27b
--- /dev/null
+++ b/cmake/Modules/FindAD9361.cmake
@@ -0,0 +1,52 @@
+# Copyright 2021 Horden Engineering
+# Author: Adam Horden <adam.horden@horden.engineering>
+#
+# This file is part of GNU Radio
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+
+# - Find libad9361
+# Find the native libad9361 includes and library
+#
+# LIBAD9361_FOUND - True if libad9361 is found.
+# LIBAD9361_INCLUDE_DIR - Where to find ad9361.h.
+# LIBAD9361_LIBRARIES - List of libraries when using libad9361.
+
+set(LIBAD9361_NAMES ad9361)
+find_library(LIBAD9361_LIBRARY
+ NAMES ${LIBAD9361_NAMES}
+ PATHS /usr/lib
+ /usr/lib64
+ /usr/local/lib
+ /usr/local/lib64
+ /opt/local/lib
+ /opt/local/lib64
+)
+
+find_path(LIBAD9361_INCLUDE_DIR ad9361.h
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+)
+
+if (LIBAD9361_INCLUDE_DIR AND LIBAD9361_LIBRARY)
+ set(LIBAD9361_FOUND TRUE)
+ set(LIBAD9361_INCLUDE_DIRS ${LIBAD9361_INCLUDE_DIR})
+ set(LIBAD9361_LIBRARIES ${LIBAD9361_LIBRARY})
+else ()
+ set(LIBAD9361_FOUND FALSE)
+ set(LIBAD9361_INCLUDE_DIR "")
+ set(LIBAD9361_INCLUDE_DIRS "")
+ set(LIBAD9361_LIBRARY "")
+ set(LIBAD9361_LIBRARIES "")
+endif ()
+
+if (LIBAD9361_FOUND)
+ message(STATUS "Found libad9361 library: ${LIBAD9361_LIBRARIES}")
+endif ()
+
+mark_as_advanced(
+ LIBAD9361_INCLUDE_DIRS
+ LIBAD9361_LIBRARIES
+)
diff --git a/cmake/Modules/FindIIO.cmake b/cmake/Modules/FindIIO.cmake
new file mode 100644
index 0000000000..a14c216984
--- /dev/null
+++ b/cmake/Modules/FindIIO.cmake
@@ -0,0 +1,52 @@
+# Copyright 2021 Horden Engineering
+# Author: Adam Horden <adam.horden@horden.engineering>
+#
+# This file is part of GNU Radio
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+
+# - Find libiio
+# Find the native libiio includes and library
+#
+# LIBIIO_FOUND - True if libiio is found.
+# LIBIIO_INCLUDE_DIR - Where to find iio.h.
+# LIBIIO_LIBRARIES - List of libraries when using libiio.
+
+set(LIBIIO_NAMES iio)
+find_library(LIBIIO_LIBRARY
+ NAMES ${LIBIIO_NAMES}
+ PATHS /usr/lib
+ /usr/lib64
+ /usr/local/lib
+ /usr/local/lib64
+ /opt/local/lib
+ /opt/local/lib64
+)
+
+find_path(LIBIIO_INCLUDE_DIR iio.h
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+)
+
+if (LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARY)
+ set(LIBIIO_FOUND TRUE)
+ set(LIBIIO_INCLUDE_DIRS ${LIBIIO_INCLUDE_DIR})
+ set(LIBIIO_LIBRARIES ${LIBIIO_LIBRARY})
+else ()
+ set(LIBIIO_FOUND FALSE)
+ set(LIBIIO_INCLUDE_DIR "")
+ set(LIBIIO_INCLUDE_DIRS "")
+ set(LIBIIO_LIBRARY "")
+ set(LIBIIO_LIBRARIES "")
+endif ()
+
+if (LIBIIO_FOUND)
+ message(STATUS "Found libiio library: ${LIBIIO_LIBRARIES}")
+endif ()
+
+mark_as_advanced(
+ LIBIIO_INCLUDE_DIRS
+ LIBIIO_LIBRARIES
+)