From c5cdbed8dc9db1887e8b2f5956a81f19d21b01c0 Mon Sep 17 00:00:00 2001 From: Matej Kenda Date: Mon, 16 Mar 2020 13:58:35 +0100 Subject: [PATCH] libini added as a submodule and compiled/linked directly into libiio. Signed-off-by: Matej Kenda --- .gitmodules | 3 +++ CMakeLists.txt | 12 ++++-------- deps/libini | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) create mode 160000 deps/libini diff --git a/.gitmodules b/.gitmodules index 0cb2af3d7..dd8dd730a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "deps/wingetopt"] path = deps/wingetopt url = https://github.com/alex85k/wingetopt.git +[submodule "deps/libini"] + path = deps/libini + url = https://github.com/pcercuei/libini.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8121df817..2a4aedaa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,14 +164,10 @@ if(WITH_LOCAL_BACKEND) option(WITH_LOCAL_CONFIG "Read local context attributes from /etc/libiio.ini" OFF) if (WITH_LOCAL_CONFIG) - find_library(LIBINI_LIBRARIES ini) - find_path(LIBINI_INCLUDE_DIR ini.h) - if (NOT LIBINI_LIBRARIES OR NOT LIBINI_INCLUDE_DIR) - message(SEND_ERROR "WITH_LOCAL_CONFIG option requires libini to be installed") - else() - include_directories(${LIBINI_INCLUDE_DIR}) - list(APPEND LIBS_TO_LINK ${LIBINI_LIBRARIES}) - endif() + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/libini) + set(LIBINI_C_FILE ${CMAKE_CURRENT_SOURCE_DIR}/deps/libini/libini.c) + + list(APPEND LIBIIO_CFILES ${LIBINI_C_FILE}) endif() endif() diff --git a/deps/libini b/deps/libini new file mode 160000 index 000000000..c3413da9a --- /dev/null +++ b/deps/libini @@ -0,0 +1 @@ +Subproject commit c3413da9ae525b0e7d3962076963c79ed573597a