Skip to content

Commit

Permalink
adrv9002 plugin: rework for navassa-profile-gen-cli compatibility
Browse files Browse the repository at this point in the history
- included cJSON for generating the adrv9002 structure config

Signed-off-by: Andrei Popa <[email protected]>
  • Loading branch information
andrei47w committed Oct 13, 2023
1 parent 4c1274a commit edd0bcc
Show file tree
Hide file tree
Showing 7 changed files with 3,816 additions and 242 deletions.
38 changes: 1 addition & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ endif()
set(OSC_SRC osc.c oscplot.c datatypes.c iio_widget.c iio_utils.c
fru.c dialogs.c trigger_dialog.c xml_utils.c libini/libini.c
libini2.c phone_home.c plugins/dac_data_manager.c
plugins/fir_filter.c eeprom.c osc_preferences.c)
plugins/fir_filter.c eeprom.c osc_preferences.c cJSON/cJSON.c)

find_package(PkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0)
Expand Down Expand Up @@ -136,41 +136,6 @@ if ((NOT LIBAD9166_LIBRARIES) AND (NOT LIBAD9166_INCLUDE_DIRS))
set(LIBAD9166_INCLUDE_DIRS "")
endif()

find_library(LIBADRV9001_IIO_LIBRARIES adrv9001-iio NO_CACHE)
find_path(LIBADRV9001_IIO_INCLUDE_DIRS adrv9002_iio.h)

if ((NOT LIBADRV9001_IIO_LIBRARIES) OR (NOT LIBADRV9001_IIO_INCLUDE_DIRS))
set(LIBADRV9001_IIO_LIBRARIES "")
set(LIBADRV9001_IIO_INCLUDE_DIRS "")
set(LIBADRV9001_FOUND FALSE)
else()
find_library(LIBADRV9001_FILTER_LIBRARIES adrv9001-filter-designer NO_CACHE)
find_library(LIBADRV9001_PROFILE_GEN_LIBRARIES adrv9001-profile-gen NO_CACHE)
find_library(LIBADRV9001_STREAM_GEN_LIBRARIES adrv9001-stream-gen NO_CACHE)
set(LIBADRV9001_FOUND TRUE)
set(ENABLE_IIO TRUE)

add_library(libadrv9002_iio STATIC IMPORTED)
set_target_properties(libadrv9002_iio PROPERTIES IMPORTED_LOCATION ${LIBADRV9001_IIO_LIBRARIES})
set_target_properties(libadrv9002_iio PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${LIBADRV9001_IIO_INCLUDE_DIRS})

add_library(libadrv9002_filter STATIC IMPORTED)
set_target_properties(libadrv9002_filter PROPERTIES IMPORTED_LOCATION ${LIBADRV9001_FILTER_LIBRARIES})

add_library(libadrv9002_profile_gen STATIC IMPORTED)
set_target_properties(libadrv9002_profile_gen PROPERTIES IMPORTED_LOCATION ${LIBADRV9001_PROFILE_GEN_LIBRARIES})

add_library(libadrv9002_stream_gen STATIC IMPORTED)
set_target_properties(libadrv9002_stream_gen PROPERTIES IMPORTED_LOCATION ${LIBADRV9001_STREAM_GEN_LIBRARIES})

add_library(libadrv9002 INTERFACE)

target_link_libraries(libadrv9002_iio INTERFACE stdc++)
target_link_libraries(libadrv9002_stream_gen INTERFACE stdc++)
target_link_libraries(libadrv9002_profile_gen INTERFACE stdc++ libadrv9002_filter)
target_link_libraries(libadrv9002 INTERFACE libadrv9002_iio libadrv9002_filter libadrv9002_profile_gen libadrv9002_stream_gen)
endif()

find_library(LIBSERIALPORT_LIBRARIES serialport)
find_path(LIBSERIALPORT_INCLUDE_DIR libserialport.h)
if (LIBSERIALPORT_LIBRARIES AND LIBSERIALPORT_INCLUDE_DIR)
Expand Down Expand Up @@ -201,7 +166,6 @@ set(LIBOSC_LIBS
${MATIO_LIBRARIES}
${LIBAD9361_LIBRARIES}
${LIBAD9166_LIBRARIES}
libadrv9002
dl
)

Expand Down
Loading

0 comments on commit edd0bcc

Please sign in to comment.