diff options
author | Michael Auchter <michael.auchter@ni.com> | 2019-09-09 16:46:14 -0500 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-05-31 05:28:47 -0700 |
commit | 530cb0a8aaaac906fe124086e780d6651241b0ad (patch) | |
tree | 8a5301163392b3d0c1642da0cb9ba2a9ea176401 /mpm/tools/tlv_eeprom/CMakeLists.txt | |
parent | fa997d52cc62c3c39f5b7560890e31d41e4eb9e9 (diff) | |
download | uhd-530cb0a8aaaac906fe124086e780d6651241b0ad.tar.gz uhd-530cb0a8aaaac906fe124086e780d6651241b0ad.tar.bz2 uhd-530cb0a8aaaac906fe124086e780d6651241b0ad.zip |
mpm: add tlv_eeprom
Add support for parsing an eeprom that uses tag-length-value to store
contents.
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes@ni.com>
Diffstat (limited to 'mpm/tools/tlv_eeprom/CMakeLists.txt')
-rw-r--r-- | mpm/tools/tlv_eeprom/CMakeLists.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mpm/tools/tlv_eeprom/CMakeLists.txt b/mpm/tools/tlv_eeprom/CMakeLists.txt new file mode 100644 index 000000000..75cf3c9cc --- /dev/null +++ b/mpm/tools/tlv_eeprom/CMakeLists.txt @@ -0,0 +1,40 @@ +# +# Copyright 2019 Ettus Research, a National Instruments Brand +# +# SPDX-License-Identifier: GPL-3.0-or-later +# + +set(eeprom_tool_sources) +set(eeprom_tool_libs) + +if(ENABLE_LIBMPM AND ENABLE_X400) + message(STATUS "Adding MPM EEPROM tools...") + set(eeprom_tool_libs tlv_eeprom.c tlv_eeprom_io.c crc.c eeprom-pids.c) + list(APPEND eeprom_tool_sources + eeprom-dump.c + eeprom-id.c + eeprom-init.c + ) + + add_executable(eeprom-update-core eeprom-init.c ${eeprom_tool_libs}) + target_compile_definitions(eeprom-update-core PRIVATE -DTLV_EEPROM_UPDATE) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/eeprom-update-core DESTINATION ${RUNTIME_DIR}) + add_custom_target(eeprom-update ALL COMMAND ${CMAKE_COMMAND} -E create_symlink eeprom-wrapper eeprom-update) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/eeprom-update DESTINATION ${RUNTIME_DIR}) +endif(ENABLE_LIBMPM AND ENABLE_X400) + +foreach(eeprom_tool_source ${eeprom_tool_sources}) + get_filename_component(eeprom_tool ${eeprom_tool_source} NAME_WE) + # install eeprom-id, eeprom-dump, etc. with "-core" appendix + add_executable(${eeprom_tool}-core ${eeprom_tool_source} ${eeprom_tool_libs}) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${eeprom_tool}-core DESTINATION ${RUNTIME_DIR}) + # install eeprom-id, eeprom-dump, etc. wrappers + add_custom_target(${eeprom_tool} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink eeprom-wrapper ${eeprom_tool}) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${eeprom_tool} DESTINATION ${RUNTIME_DIR}) +endforeach(eeprom_tool_source ${eeprom_tool_sources}) + +install(PROGRAMS + eeprom-path + eeprom-wrapper + DESTINATION ${RUNTIME_DIR} +) |