From 101bec310f7b27e0586d5f37afe04e10268af5c0 Mon Sep 17 00:00:00 2001 From: srcejon Date: Wed, 1 Feb 2023 14:18:59 +0000 Subject: [PATCH 1/2] Copy fftw3f and libusb dlls to bin directory. --- CMakeLists.txt | 6 +++++- cmake/cpack/CMakeLists.txt | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f4ffaa5c..9727f5e31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,10 +300,14 @@ elseif (WIN32) set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/include" CACHE INTERNAL "") set(FFTW3F_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/libfftw3f-3.lib" CACHE INTERNAL "") set(FFTW3F_WISDOM "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/fftwf-wisdom.exe" CACHE INTERNAL "") + set(FFTW3F_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/fftw-3" CACHE INTERNAL "") + set(LIBUSB_FOUND ON CACHE INTERNAL "") set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libusb/include" CACHE INTERNAL "") set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll/libusb-1.0.lib" CACHE INTERNAL "") - if(VS2019) + set(LIBUSB_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll" CACHE INTERNAL "") + +if(VS2019) set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv4" CACHE INTERNAL "") else() set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv" CACHE INTERNAL "") diff --git a/cmake/cpack/CMakeLists.txt b/cmake/cpack/CMakeLists.txt index 80a78c404..1345ce61e 100644 --- a/cmake/cpack/CMakeLists.txt +++ b/cmake/cpack/CMakeLists.txt @@ -168,6 +168,22 @@ elseif(WIN32 OR MINGW) endforeach(soapysupport_dll) endif() + file(GLOB FFTW3F_DLLS "${FFTW3F_DLL_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}") + foreach(fftw3f_dll ${FFTW3F_DLLS}) + get_filename_component(fftw3f_dll_name "${fftw3f_dll}" NAME) + add_custom_target(copy_fftw3f_${fftw3f_dll_name} ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${fftw3f_dll}" "${SDRANGEL_BINARY_BIN_DIR}/" + ) + endforeach(fftw3f_dll) + + file(GLOB LIBUSB_DLLS "${LIBUSB_DLL_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}") + foreach(libusb_dll ${LIBUSB_DLLS}) + get_filename_component(libusb_dll_name "${libusb_dll}" NAME) + add_custom_target(copy_fftw3f_${libusb_dll_name} ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${libusb_dll}" "${SDRANGEL_BINARY_BIN_DIR}/" + ) + endforeach(libusb_dll) + file(GLOB CODEC2_DLLS "${CODEC2_DLL_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}") foreach(codec2_dll ${CODEC2_DLLS}) get_filename_component(codec2_dll_name "${codec2_dll}" NAME) From 0d055fe036c9685a2e69a84da4409394362f4262 Mon Sep 17 00:00:00 2001 From: srcejon Date: Wed, 1 Feb 2023 14:21:21 +0000 Subject: [PATCH 2/2] Fix target name --- cmake/cpack/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/cpack/CMakeLists.txt b/cmake/cpack/CMakeLists.txt index 1345ce61e..704efac23 100644 --- a/cmake/cpack/CMakeLists.txt +++ b/cmake/cpack/CMakeLists.txt @@ -179,7 +179,7 @@ elseif(WIN32 OR MINGW) file(GLOB LIBUSB_DLLS "${LIBUSB_DLL_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}") foreach(libusb_dll ${LIBUSB_DLLS}) get_filename_component(libusb_dll_name "${libusb_dll}" NAME) - add_custom_target(copy_fftw3f_${libusb_dll_name} ALL + add_custom_target(copy_libusb_${libusb_dll_name} ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different "${libusb_dll}" "${SDRANGEL_BINARY_BIN_DIR}/" ) endforeach(libusb_dll)