2017-09-01 22:21:41 -04:00
|
|
|
if(NOT LIBIIO_FOUND)
|
|
|
|
|
2019-05-09 08:18:27 -04:00
|
|
|
pkg_check_modules (LIBIIO_PKG libiio>=0.7)
|
2017-09-01 22:21:41 -04:00
|
|
|
|
2019-05-22 05:36:16 -04:00
|
|
|
if(LIBIIO_PKG_FOUND OR (DEFINED IIO_DIR))
|
2019-05-09 08:18:27 -04:00
|
|
|
find_path(LIBIIO_INCLUDE_DIR
|
|
|
|
NAMES iio.h
|
2019-07-25 20:04:42 -04:00
|
|
|
HINTS ${IIO_DIR}/include
|
|
|
|
${LIBIIO_PKG_INCLUDE_DIRS}
|
|
|
|
PATHS /usr/include
|
|
|
|
/usr/local/include
|
2019-05-09 08:18:27 -04:00
|
|
|
)
|
2017-09-01 22:21:41 -04:00
|
|
|
|
2019-05-09 08:18:27 -04:00
|
|
|
find_library(LIBIIO_LIBRARIES
|
|
|
|
NAMES iio
|
2019-07-25 20:04:42 -04:00
|
|
|
HINTS ${IIO_DIR}/lib
|
|
|
|
${LIBIIO_PKG_LIBRARY_DIRS}
|
|
|
|
PATHS /usr/lib
|
|
|
|
/usr/local/lib
|
2019-05-09 08:18:27 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
if(LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARIES)
|
2019-05-22 05:36:16 -04:00
|
|
|
set(LIBIIO_FOUND TRUE CACHE INTERNAL "libiio found")
|
|
|
|
message(STATUS "Found libiio: ${LIBIIO_INCLUDE_DIR}, ${LIBIIO_LIBRARIES}")
|
|
|
|
else(LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARIES)
|
|
|
|
set(LIBIIO_FOUND FALSE CACHE INTERNAL "libiio found")
|
|
|
|
message(STATUS "libiio not found.")
|
|
|
|
endif(LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARIES)
|
2017-09-01 22:21:41 -04:00
|
|
|
|
2019-05-22 05:36:16 -04:00
|
|
|
mark_as_advanced(LIBIIO_INCLUDE_DIR LIBIIO_LIBRARIES)
|
2017-09-01 22:21:41 -04:00
|
|
|
|
2019-05-22 05:36:16 -04:00
|
|
|
endif(LIBIIO_PKG_FOUND OR (DEFINED IIO_DIR))
|
2019-05-09 08:18:27 -04:00
|
|
|
|
2017-09-01 22:21:41 -04:00
|
|
|
endif(NOT LIBIIO_FOUND)
|