hackrf_sweep on Windows
added precompiled fftw-3.3.5
This commit is contained in:
@ -63,11 +63,16 @@ make install
|
||||
###For Visual Studio 2015 x64
|
||||
```
|
||||
c:\hackrf\host\build> cmake ../ -G "Visual Studio 14 2015 Win64" \
|
||||
-DLIBUSB_INCLUDE_DIR=c:\libusb-1.0.18-win\include\libusb-1.0 \
|
||||
-DLIBUSB_LIBRARIES=c:\libusb-1.0.18-win\MS64\static\libusb-1.0.lib \
|
||||
-DLIBUSB_INCLUDE_DIR=c:\libusb-1.0.21\libusb \
|
||||
-DLIBUSB_LIBRARIES=c:\libusb-1.0.21\x64\Release\lib\libusb-1.0.lib \
|
||||
-DTHREADS_PTHREADS_INCLUDE_DIR=c:\pthreads-w32-2-9-1-release\Pre-built.2\include \
|
||||
-DTHREADS_PTHREADS_WIN32_LIBRARY=c:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\pthreadVC2.lib
|
||||
-DTHREADS_PTHREADS_WIN32_LIBRARY=c:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\pthreadVC2.lib \
|
||||
-DFFTW_INCLUDES=C:\hackrf-2017.02.1\host\hackrf-tools\fftw-3.3.5-dll64 \
|
||||
-DFFTW_LIBRARIES=C:\hackrf-2017.02.1\host\hackrf-tools\fftw-3.3.5-dll64\libfftw3f-3.lib
|
||||
```
|
||||
unpack precompiled fftw-3.3.5-dll64.zip from http://www.fftw.org/install/windows.html to C:\hackrf-2017.02.1\host\hackrf-tools\fftw-3.3.5-dll64
|
||||
Create library from VS command shell
|
||||
C:\hackrf-2017.02.1\host\hackrf-tools\fftw-3.3.5-dll6> lib /machine:x64 /def:libfftw3f-3.def
|
||||
|
||||
Cmake will produce a solution file named `hackrf_all.sln` and a series of
|
||||
project files which can be used with msbuild as follows:
|
||||
|
@ -12,7 +12,15 @@ endif (FFTW_INCLUDES)
|
||||
|
||||
find_path (FFTW_INCLUDES fftw3.h)
|
||||
|
||||
IF (WIN32)
|
||||
include_directories(${FFTW_INCLUDES})
|
||||
find_library (FFTW_LIBRARIES NAMES ${FFTW_LIBRARIES})
|
||||
ELSE(WIN32)
|
||||
find_library (FFTW_LIBRARIES NAMES fftw3)
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
@ -31,12 +31,15 @@ SET(TOOLS
|
||||
hackrf_cpldjtag
|
||||
hackrf_info
|
||||
hackrf_debug
|
||||
hackrf_sweep
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
add_library(libgetopt_static STATIC
|
||||
../getopt/getopt.c
|
||||
)
|
||||
LIST(APPEND TOOLS_LINK_LIBS ${FFTW_LIBRARIES})
|
||||
include_directories(${FFTW_INCLUDES})
|
||||
else()
|
||||
pkg_check_modules(FFTW REQUIRED fftw3f)
|
||||
LIST(APPEND TOOLS hackrf_sweep)
|
||||
|
@ -47,7 +47,7 @@ typedef int bool;
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846264338327950288
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#ifdef _WIN64
|
||||
@ -517,6 +517,9 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
fd = fopen(path, "wb");
|
||||
if (fd == NULL) {
|
||||
fd = fopen("nul", "wb");
|
||||
}
|
||||
if( fd == NULL ) {
|
||||
fprintf(stderr, "Failed to open file: %s\n", path);
|
||||
return EXIT_FAILURE;
|
||||
|
Reference in New Issue
Block a user