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