Skip to content

Commit

Permalink
Merge branch 'cmake-cleanup' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Aug 3, 2024
2 parents 09fd665 + 4f060e6 commit 855821f
Show file tree
Hide file tree
Showing 56 changed files with 584 additions and 626 deletions.
64 changes: 32 additions & 32 deletions GUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,36 @@ if(NOT ENABLE_GUI)
return()
endif()

set(GUI_SOURCES
limeGUI.cpp
limeGUIFrame.cpp
LMS_Programming/LMS_Programming_wxgui.cpp
utility/pnlMiniLog.cpp
utility/SPI_wxgui.cpp
utility/dlgFullMessageLog.cpp
utility/utilities_gui.cpp
dlgAbout_view.cpp
dlgAbout.cpp
numericSlider/numericSlider.cpp
fftviewer_wxgui/fftviewer_wxgui.cpp
fftviewer_wxgui/fftviewer_frFFTviewer.cpp
CommsToDevice.cpp
DeviceConnectionPanel.cpp
events.cpp
SDRConfiguration_view.cpp
parsers/CoefficientFileParser.cpp)

include(${wxWidgets_USE_FILE})
add_subdirectory(oglGraph)

add_executable(limeGUI resources/resource.rc)

set(BINARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
set(GUI_EXECUTABLE_NAME limeGUI)
set_target_properties(limeGUI PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BINARY_OUTPUT_DIR})

target_sources(
limeGUI
PRIVATE limeGUI.cpp
limeGUIFrame.cpp
LMS_Programming/LMS_Programming_wxgui.cpp
utility/pnlMiniLog.cpp
utility/SPI_wxgui.cpp
utility/dlgFullMessageLog.cpp
utility/utilities_gui.cpp
dlgAbout_view.cpp
dlgAbout.cpp
numericSlider/numericSlider.cpp
fftviewer_wxgui/fftviewer_wxgui.cpp
fftviewer_wxgui/fftviewer_frFFTviewer.cpp
CommsToDevice.cpp
DeviceConnectionPanel.cpp
events.cpp
SDRConfiguration_view.cpp
parsers/CoefficientFileParser.cpp)

add_executable(${GUI_EXECUTABLE_NAME} ${GUI_SOURCES} resources/resource.rc)
set_target_properties(${GUI_EXECUTABLE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BINARY_OUTPUT_DIR})
target_compile_definitions(${GUI_EXECUTABLE_NAME} PRIVATE WIN32_LEAN_AND_MEAN)
target_include_directories(
${GUI_EXECUTABLE_NAME}
PRIVATE ${LIME_SUITE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
limeGUI
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
lms7002_wxgui
utilities_gui
FPGAcontrols_wxgui
Expand All @@ -112,15 +110,17 @@ target_include_directories(

add_subdirectory(boards)
add_subdirectory(chips)
add_subdirectory(oglGraph)

target_link_libraries(
${GUI_EXECUTABLE_NAME}
PUBLIC limesuiteng oglGraph ${wxWidgets_LIBRARIES}
limeGUI
PUBLIC limesuiteng ${wxWidgets_LIBRARIES}
PRIVATE kissfft)

if(MSVC)
target_compile_definitions(limeGUI PRIVATE WIN32_LEAN_AND_MEAN)
set_property(
TARGET ${GUI_EXECUTABLE_NAME}
TARGET limeGUI
APPEND
PROPERTY LINK_FLAGS /SUBSYSTEM:WINDOWS)
endif(MSVC)
Expand All @@ -139,7 +139,7 @@ if(WIN32)
set(release_dir "$<$<NOT:$<CONFIG:Debug>>:/ReleaseDLLs/lib/vc14x${x64_postfix}_dll>")

add_custom_command(
TARGET ${GUI_EXECUTABLE_NAME}
TARGET limeGUI
POST_BUILD
COMMAND
${CMAKE_COMMAND} -E copy_if_different
Expand All @@ -149,4 +149,4 @@ if(WIN32)
${BINARY_OUTPUT_DIR}${additional_folder})
endif(WIN32)

install(TARGETS ${GUI_EXECUTABLE_NAME} DESTINATION bin)
install(TARGETS limeGUI DESTINATION bin)
3 changes: 1 addition & 2 deletions GUI/boards/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
target_sources(
${GUI_EXECUTABLE_NAME}
PRIVATE pnlBoardControls.cpp pnlBuffers.cpp pnlGPIO.cpp pnlX3.cpp pnlX8.cpp pnlXTRX.cpp pnluLimeSDR.cpp pnlLimeSDR.cpp)
limeGUI PRIVATE pnlBoardControls.cpp pnlBuffers.cpp pnlGPIO.cpp pnlX3.cpp pnlX8.cpp pnlXTRX.cpp pnluLimeSDR.cpp pnlLimeSDR.cpp)
2 changes: 1 addition & 1 deletion GUI/chips/ADF4002/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
target_sources(${GUI_EXECUTABLE_NAME} PRIVATE ADF4002_wxgui.cpp)
target_sources(limeGUI PRIVATE ADF4002_wxgui.cpp)
2 changes: 1 addition & 1 deletion GUI/chips/CDCM6208/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
target_sources(${GUI_EXECUTABLE_NAME} PRIVATE CDCM6208_wxgui.cpp)
target_sources(limeGUI PRIVATE CDCM6208_wxgui.cpp)
55 changes: 27 additions & 28 deletions GUI/chips/LMS7002M/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
set(LMS7002M_GUI_SOURCES
ILMS7002MTab.cpp
lms7002_pnlXBUF_view.cpp
lms7002_pnlRFE_view.cpp
lms7002_pnlCalibrations_view.cpp
lms7002_pnlTRF_view.cpp
lms7002_pnlCDS_view.cpp
lms7002_pnlLimeLightPAD_view.cpp
lms7002_pnlBIST_view.cpp
dlgViewIRAM.cpp
lms7002_gui_utilities.cpp
lms7002_pnlSX_view.cpp
lms7002_pnlTBB_view.cpp
lms7002_dlgVCOfrequencies.cpp
lms7002_pnlRBB_view.cpp
lms7002_pnlLDO_view.cpp
lms7002_pnlAFE_view.cpp
lms7002_pnlGains_view.cpp
lms7002_pnlRxTSP_view.cpp
lms7002_mainPanel.cpp
lms7002_pnlCLKGEN_view.cpp
lms7002_pnlMCU_BD_view.cpp
lms7002_pnlBIAS_view.cpp
lms7002_dlgGFIR_Coefficients.cpp
lms7002_pnlTxTSP_view.cpp
lms7002_pnlR3.cpp)

target_sources(${GUI_EXECUTABLE_NAME} PRIVATE ${LMS7002M_GUI_SOURCES})
target_sources(
limeGUI
PRIVATE ILMS7002MTab.cpp
lms7002_pnlXBUF_view.cpp
lms7002_pnlRFE_view.cpp
lms7002_pnlCalibrations_view.cpp
lms7002_pnlTRF_view.cpp
lms7002_pnlCDS_view.cpp
lms7002_pnlLimeLightPAD_view.cpp
lms7002_pnlBIST_view.cpp
dlgViewIRAM.cpp
lms7002_gui_utilities.cpp
lms7002_pnlSX_view.cpp
lms7002_pnlTBB_view.cpp
lms7002_dlgVCOfrequencies.cpp
lms7002_pnlRBB_view.cpp
lms7002_pnlLDO_view.cpp
lms7002_pnlAFE_view.cpp
lms7002_pnlGains_view.cpp
lms7002_pnlRxTSP_view.cpp
lms7002_mainPanel.cpp
lms7002_pnlCLKGEN_view.cpp
lms7002_pnlMCU_BD_view.cpp
lms7002_pnlBIAS_view.cpp
lms7002_dlgGFIR_Coefficients.cpp
lms7002_pnlTxTSP_view.cpp
lms7002_pnlR3.cpp)
2 changes: 1 addition & 1 deletion GUI/chips/Si5351C/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
target_sources(${GUI_EXECUTABLE_NAME} PRIVATE Si5351C_wxgui.cpp)
target_sources(limeGUI PRIVATE Si5351C_wxgui.cpp)
17 changes: 3 additions & 14 deletions GUI/oglGraph/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set(oglGraph_src_files dlgMarkers.cpp GLFont.cpp OpenGLGraph.cpp)

set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
if(NOT TARGET OpenGL::GL)
Expand All @@ -8,23 +6,14 @@ endif(NOT TARGET OpenGL::GL)
message(STATUS "OPENGL_INCLUDE_DIR: ${OPENGL_INCLUDE_DIR}")
message(STATUS "OPENGL_LIBRARIES: ${OPENGL_LIBRARIES}")

add_library(oglGraph STATIC ${oglGraph_src_files})

target_include_directories(
oglGraph
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${OPENGL_INCLUDE_DIR} # public, because <wx/glcanvas.h> includes GL/gl.h but the include dir is not added by wxWidgets
)
target_sources(limeGUI PRIVATE dlgMarkers.cpp GLFont.cpp OpenGLGraph.cpp)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Ignore warnings about narrowing: static font header
target_compile_options(oglGraph PRIVATE -Wno-narrowing -Wno-address)
endif()
target_include_directories(limeGUI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${OPENGL_INCLUDE_DIR})

if(APPLE)
set(GL_LIBS "-framework OpenGL" "-framework GLUT")
elseif(UNIX)
set(GL_LIBS ${OPENGL_LIBRARIES})
endif()

target_link_libraries(oglGraph PUBLIC GLEW ${GL_LIBS} ${wxWidgets_LIBRARIES})
target_link_libraries(limeGUI PRIVATE GLEW ${GL_LIBS})
8 changes: 3 additions & 5 deletions embedded/lms7002m/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
add_library(lms7002m STATIC lms7002m.c calibrations.c privates.c save_state.c spi.c)

set_property(TARGET lms7002m PROPERTY POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(lms7002m PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

# deny usage of floating point operations, ideally everything should be done using integers only
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(lms7002m PRIVATE -fvisibility=hidden)
target_compile_options(lms7002m PRIVATE -mgeneral-regs-only)
endif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
target_compile_options(lms7002m PRIVATE -mgeneral-regs-only -fvisibility=hidden)
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
target_compile_options(lms7002m PRIVATE -mno-sse)
endif()

Expand Down
54 changes: 45 additions & 9 deletions external/FTD3XXLibrary/FTD3XX.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ typedef PVOID FT_HANDLE, *PFT_HANDLE;
//
// FT Status Codes
//
typedef enum _FT_STATUS
enum _FT_STATUS
{
FT_OK,
FT_INVALID_HANDLE,
Expand Down Expand Up @@ -251,6 +251,17 @@ typedef struct _FT_STRING_DESCRIPTOR

} FT_STRING_DESCRIPTOR, *PFT_STRING_DESCRIPTOR;

typedef struct _FT_ENDPOINT_DESCRIPTOR
{
UCHAR bLength;
UCHAR bDescriptorType;
UCHAR bEndpointAddress;
UCHAR bmAttributes;
USHORT wMaxPacketSize;
UCHAR bInterval;

} FT_ENDPOINT_DESCRIPTOR, * PFT_ENDPOINT_DESCRIPTOR;

//
// Pipe information
//
Expand Down Expand Up @@ -375,19 +386,17 @@ typedef enum
{
CONFIGURATION_OPTIONAL_FEATURE_DISABLEALL = 0,
CONFIGURATION_OPTIONAL_FEATURE_ENABLEBATTERYCHARGING = (0x1 << 0),
CONFIGURATION_OPTIONAL_FEATURE_DISABLECANCELSESSIONUNDERRUN = (0x1 << 1),
CONFIGURATION_OPTIONAL_FEATURE_DISABLECANCELSESSIONUNDERRUN = (0x1 << 1), /* Setting this will Ignore session underrun */
CONFIGURATION_OPTIONAL_FEATURE_ENABLENOTIFICATIONMESSAGE_INCH1 = (0x1 << 2),
CONFIGURATION_OPTIONAL_FEATURE_ENABLENOTIFICATIONMESSAGE_INCH2 = (0x1 << 3),
CONFIGURATION_OPTIONAL_FEATURE_ENABLENOTIFICATIONMESSAGE_INCH3 = (0x1 << 4),
CONFIGURATION_OPTIONAL_FEATURE_ENABLENOTIFICATIONMESSAGE_INCH4 = (0x1 << 5),
CONFIGURATION_OPTIONAL_FEATURE_ENABLENOTIFICATIONMESSAGE_INCHALL = (0xF << 2),
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH1 = (0x1 << 6),
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH2 = (0x1 << 7),
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH3 = (0x1 << 8),
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH4 = (0x1 << 9),
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCHALL = (0xF << 6),
CONFIGURATION_OPTIONAL_FEATURE_SUPPORT_ENABLE_FIFO_IN_SUSPEND = (1 << 10),
CONFIGURATION_OPTIONAL_FEATURE_SUPPORT_DISABLE_CHIP_POWERDOWN = (1 << 11),
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH1 = (0x1 << 6), /* Setting this will Ignore underrun at FIFO Bus-Width for IN channel#1 */
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH2 = (0x1 << 7), /* Setting this will Ignore underrun at FIFO Bus-Width for IN channel#2 */
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH3 = (0x1 << 8), /* Setting this will Ignore underrun at FIFO Bus-Width for IN channel#3 */
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCH4 = (0x1 << 9), /* Setting this will Ignore underrun at FIFO Bus-Width for IN channel#4 */
CONFIGURATION_OPTIONAL_FEATURE_DISABLEUNDERRUN_INCHALL = (0xF << 6), /* Setting this will Ignore underrun at FIFO Bus-Width for all IN channel */
CONFIGURATION_OPTIONAL_FEATURE_ENABLEALL = 0xFFFF,

} CONFIGURATION_OPTIONAL_FEATURE_SUPPORT;
Expand Down Expand Up @@ -548,6 +557,26 @@ extern "C" {
LPOVERLAPPED pOverlapped
);

FTD3XX_API
FT_STATUS WINAPI FT_WritePipeEx(
FT_HANDLE ftHandle,
UCHAR ucPipeID,
PUCHAR pucBuffer,
ULONG ulBufferLength,
PULONG pulBytesTransferred,
LPOVERLAPPED pOverlapped
);

FTD3XX_API
FT_STATUS WINAPI FT_ReadPipeEx(
FT_HANDLE ftHandle,
UCHAR ucPipeID,
PUCHAR pucBuffer,
ULONG ulBufferLength,
PULONG pulBytesTransferred,
LPOVERLAPPED pOverlapped
);

FTD3XX_API
FT_STATUS WINAPI FT_GetOverlappedResult(
FT_HANDLE ftHandle,
Expand Down Expand Up @@ -796,6 +825,13 @@ extern "C" {
UINT32 u32Pull
);

FTD3XX_API
FT_STATUS WINAPI FT_SetGPIOLevel(
FT_HANDLE ftHandle,
UINT32 u32Mask,
UINT32 u32Level
);

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 855821f

Please sign in to comment.