Commit abf04db9 authored by Robert Schmidt's avatar Robert Schmidt

Allow to use cmake to generate T tracer programs

- Add CMakeLists.txt to build all T tracer user tools
- Previous Makefiles are retained in common/utils/T: you can do
  $ cd common/utils/T/tracer
  $ make # all executables are there
  or also
  $ mkdir build && cd build
  $ cmake .. -GNinja
  $ ninja T_tools # all executables are in build/common/utils/T/tracer
parent a9e8a02d
add_executable(genids genids.c)
set_target_properties(genids PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)
add_custom_command(OUTPUT T_IDs.h
COMMAND ./genids ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt T_IDs.h
......@@ -17,6 +18,7 @@ target_include_directories(_check_vcd PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(_check_vcd PRIVATE -Wall)
target_link_libraries(_check_vcd PRIVATE m pthread)
set_target_properties(_check_vcd PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)
add_custom_target(check_vcd
COMMAND _check_vcd ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt ${CMAKE_CURRENT_SOURCE_DIR}/../LOG/vcd_signal_dumper.h
......@@ -43,4 +45,6 @@ if(T_TRACER)
add_library(T STATIC T.c local_tracer.c T_IDs.h T_messages.txt.h)
target_link_libraries(T PUBLIC rt)
target_link_libraries(T PRIVATE CONFIG_LIB T_headers)
add_subdirectory(tracer)
endif()
add_library(tracer_utils OBJECT config.c database.c event.c handler.c utils.c)
target_link_libraries(tracer_utils PUBLIC m pthread)
add_library(tracer_events OBJECT event_selector.c)
add_executable(record record.c)
target_link_libraries(record PRIVATE tracer_utils)
add_executable(replay replay.c)
target_link_libraries(replay PRIVATE tracer_utils)
add_executable(extract_config extract_config.c)
target_link_libraries(extract_config PRIVATE tracer_utils)
add_executable(extract_input_subframe extract_input_subframe.c)
target_link_libraries(extract_input_subframe PRIVATE tracer_utils)
add_executable(extract_output_subframe extract_output_subframe.c)
target_link_libraries(extract_output_subframe PRIVATE tracer_utils)
add_executable(extract extract.c)
target_link_libraries(extract PRIVATE tracer_utils)
add_executable(textlog textlog.c)
target_link_libraries(textlog PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
find_library(png png REQUIRED)
add_executable(enb enb.c)
target_link_libraries(enb PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
target_link_libraries(enb PRIVATE png)
add_executable(ue ue.c)
target_link_libraries(ue PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
target_link_libraries(ue PRIVATE png)
add_executable(vcd vcd.c)
target_link_libraries(vcd PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
add_executable(to_vcd to_vcd.c)
target_link_libraries(to_vcd PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
add_executable(macpdu2wireshark macpdu2wireshark.c)
target_link_libraries(macpdu2wireshark PRIVATE tracer_utils)
add_executable(multi multi.c)
target_link_libraries(multi PRIVATE tracer_utils T)
target_include_directories(multi PRIVATE ..)
add_executable(gnb gnb.c)
target_link_libraries(gnb PRIVATE tracer_utils tracer_filter tracer_gui
tracer_logger tracer_view tracer_events)
target_link_libraries(gnb PRIVATE png)
add_subdirectory(filter)
add_subdirectory(gui)
add_subdirectory(logger)
add_subdirectory(view)
add_custom_target(T_tools)
add_dependencies(T_tools
record replay extract_config textlog enb ue vcd macpdu2wireshark
extract_input_subframe extract_output_subframe to_vcd extract multi
gnb)
add_dependencies(nr-softmodem T_tools)
add_dependencies(nr-uesoftmodem T_tools)
add_dependencies(lte-softmodem T_tools)
add_dependencies(lte-uesoftmodem T_tools)
add_library(tracer_filter STATIC filter.c)
target_include_directories(tracer_filter PRIVATE ..)
include(FindPkgConfig)
pkg_check_modules(xft REQUIRED xft)
find_library(X11 X11 REQUIRED)
add_library(tracer_gui STATIC
init.c loop.c toplevel_window.c x.c container.c widget.c
gui.c label.c textarea.c event.c xy_plot.c textlist.c notify.c
positioner.c timeline.c space.c image.c)
target_link_libraries(tracer_gui PRIVATE pthread m ${xft_LIBRARIES} X11)
target_include_directories(tracer_gui PRIVATE ${xft_INCLUDE_DIRS})
......@@ -2,7 +2,7 @@
#define _X_DEFS_H_
#include <X11/Xlib.h>
#include <Xft.h>
#include <X11/Xft/Xft.h>
struct x_connection {
Display *d;
......
add_library(tracer_logger STATIC
logger.c textlog.c framelog.c ttilog.c timelog.c ticklog.c iqlog.c
iqdotlog.c ticked_ttilog.c throughputlog.c)
target_link_libraries(tracer_logger PRIVATE pthread tracer_filter)
target_include_directories(tracer_logger PRIVATE ..)
add_library(tracer_view STATIC
stdout.c textlist.c xy.c tti.c time.c ticktime.c scrolltti.c)
target_link_libraries(tracer_view PRIVATE pthread)
target_include_directories(tracer_view PRIVATE ../logger)
target_include_directories(tracer_view PUBLIC ..)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment