1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge pull request #1700 from srcejon/sigmf_win

Enable SigMF plugins on windows
This commit is contained in:
Edouard Griffiths 2023-05-27 20:02:37 +02:00 committed by GitHub
commit b659f1c527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 5 deletions

View File

@ -372,11 +372,18 @@ if(VS2019)
set(HIDAPI_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/hidapi/x64/hidapi.lib" CACHE INTERNAL "") set(HIDAPI_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/hidapi/x64/hidapi.lib" CACHE INTERNAL "")
set(HIDAPI_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/hidapi/x64" CACHE INTERNAL "") set(HIDAPI_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/hidapi/x64" CACHE INTERNAL "")
set(LIBSIGMF_FOUND ON CACHE INTERNAL "")
set(LIBSIGMF_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libsigmf/include" CACHE INTERNAL "")
set(LIBSIGMF_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libsigmf/lib/libsigmf.lib" DbgHelp CACHE INTERNAL "")
set(LIBSIGMF_LIBRARIES_DEBUG "${EXTERNAL_LIBRARY_FOLDER}/libsigmf/lib/libsigmfd.lib" DbgHelp CACHE INTERNAL "")
set(LIBSIGMF_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/libsigmf/lib/" CACHE INTERNAL "")
# used on fixup_bundle phase # used on fixup_bundle phase
set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS
"${EXTERNAL_LIBRARY_FOLDER}/fftw-3" "${EXTERNAL_LIBRARY_FOLDER}/fftw-3"
"${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll" "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll"
"${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/bin" "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/bin"
"${EXTERNAL_LIBRARY_FOLDER}/libsigmf/lib"
) )
elseif(ANDROID) elseif(ANDROID)
set(EXTERNAL_LIBRARY_FOLDER "${CMAKE_SOURCE_DIR}/external/android") set(EXTERNAL_LIBRARY_FOLDER "${CMAKE_SOURCE_DIR}/external/android")

View File

@ -228,6 +228,14 @@ elseif(WIN32 OR MINGW)
) )
endforeach(openssl_dll) endforeach(openssl_dll)
file(GLOB LIBSIGMF_DLLS "${LIBSIGMF_DLL_DIR}/libsigmf*${CMAKE_SHARED_LIBRARY_SUFFIX}")
foreach(libsigmf_dll ${LIBSIGMF_DLLS})
get_filename_component(libsigmf_dll_name "${libsigmf_dll}" NAME)
add_custom_target(copy_libsigmf_${libsigmf_dll_name} ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${libsigmf_dll}" "${SDRANGEL_BINARY_BIN_DIR}/"
)
endforeach(libsigmf_dll)
# TODO we need a way to fixup_bundle() on the build bin/ directory without call install # TODO we need a way to fixup_bundle() on the build bin/ directory without call install
if(BUILD_GUI) if(BUILD_GUI)
install(CODE " install(CODE "
@ -284,6 +292,9 @@ elseif(WIN32 OR MINGW)
# OpenSSL # OpenSSL
install(DIRECTORY "${OPENSSL_DLL_DIR}/" DESTINATION "${INSTALL_LIB_DIR}" install(DIRECTORY "${OPENSSL_DLL_DIR}/" DESTINATION "${INSTALL_LIB_DIR}"
FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}") FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")
# libsigmf
install(DIRECTORY "${LIBSIGMF_DLL_DIR}/" DESTINATION "${INSTALL_LIB_DIR}"
FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")
install(CODE " install(CODE "

View File

@ -101,7 +101,7 @@ if (ENABLE_CHANNELRX_DEMODM17 AND CODEC2_FOUND)
add_subdirectory(demodm17) add_subdirectory(demodm17)
endif() endif()
if (ENABLE_CHANNELRX_SIGMFFILESINK AND LIBSIGMF_FOUND AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (ENABLE_CHANNELRX_SIGMFFILESINK AND LIBSIGMF_FOUND)
add_subdirectory(sigmffilesink) add_subdirectory(sigmffilesink)
endif() endif()

View File

@ -62,7 +62,7 @@ if(ENABLE_SOAPYSDR AND SOAPYSDR_FOUND)
add_subdirectory(soapysdrinput) add_subdirectory(soapysdrinput)
endif() endif()
if(LIBSIGMF_FOUND AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(LIBSIGMF_FOUND)
add_subdirectory(sigmffileinput) add_subdirectory(sigmffileinput)
endif() endif()

View File

@ -19,6 +19,7 @@ set(sigmffileinput_HEADERS
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBSIGMF_INCLUDE_DIR} ${LIBSIGMF_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
) )
if(NOT SERVER_MODE) if(NOT SERVER_MODE)
@ -49,14 +50,24 @@ add_library(${TARGET_NAME} SHARED
${sigmffileinput_SOURCES} ${sigmffileinput_SOURCES}
) )
if (NOT WIN32)
link_directories(${Boost_LIBRARY_DIRS})
endif()
target_link_libraries(${TARGET_NAME} target_link_libraries(${TARGET_NAME}
Boost::disable_autolinking
Qt::Core Qt::Core
${TARGET_LIB} ${TARGET_LIB}
sdrbase sdrbase
${TARGET_LIB_GUI} ${TARGET_LIB_GUI}
swagger swagger
${LIBSIGMF_LIBRARIES}
) )
if(WIN32)
target_link_libraries(sdrbase optimized ${LIBSIGMF_LIBRARIES})
target_link_libraries(sdrbase debug ${LIBSIGMF_LIBRARIES_DEBUG})
else()
target_link_libraries(sdrbase ${LIBSIGMF_LIBRARIES})
endif()
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,7 +32,7 @@ else(FFTW3F_FOUND)
add_definitions(-DUSE_KISSFFT) add_definitions(-DUSE_KISSFFT)
endif(FFTW3F_FOUND) endif(FFTW3F_FOUND)
if (LIBSIGMF_FOUND AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (LIBSIGMF_FOUND)
set(sdrbase_SOURCES set(sdrbase_SOURCES
${sdrbase_SOURCES} ${sdrbase_SOURCES}
dsp/sigmffilerecord.cpp dsp/sigmffilerecord.cpp
@ -43,7 +43,6 @@ if (LIBSIGMF_FOUND AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
dsp/sigmffilerecord.h dsp/sigmffilerecord.h
) )
include_directories(${LIBSIGMF_INCLUDE_DIR}) include_directories(${LIBSIGMF_INCLUDE_DIR})
set(sdrbase_LIBSIGMF_LIB ${LIBSIGMF_LIBRARIES})
endif() endif()
if (LIBSERIALDV_FOUND) if (LIBSERIALDV_FOUND)
@ -519,6 +518,14 @@ target_link_libraries(sdrbase
qrtplib qrtplib
swagger swagger
) )
if (LIBSIGMF_FOUND)
if(WIN32)
target_link_libraries(sdrbase optimized ${LIBSIGMF_LIBRARIES})
target_link_libraries(sdrbase debug ${LIBSIGMF_LIBRARIES_DEBUG})
else()
target_link_libraries(sdrbase ${LIBSIGMF_LIBRARIES})
endif()
endif()
if (Qt6_FOUND) if (Qt6_FOUND)
target_link_libraries(sdrbase target_link_libraries(sdrbase
Qt::Core5Compat Qt::Core5Compat