You may use any version from Visual Studio 2015 onwards. The slighly different cmake commands for each version of Visual Studio are oulined below, just make sure to use the one that corresponds to your particular installation.
When installing Visual Studio, make sure to select the "Desktop development with C++" workload, which automatically includes the cmake dependecies we'll need later on.
Download and install cmake version 3.21 or greater. Make sure to select "Add to the system path" at the end of the installation.
Open a "Visual Studio Command Prompt" from the start menu by navigating to the version of Visual Studio installed, and selecting that option. This is a special command prompt that includes additional 'PATH's to Visual Studio build tools. This is the window in which the actual build will take place.
The fftw library needs to be registered (one time operation) with the Visual Studio build system. Navigate to the folder where the dependecy is installed, and run the "lib" command below:
C:\fftw-3.3.5-dll64> lib /machine:x64 /def:libfftw3f-3.def
You should see an output like this:
cmake ../ -G "Visual Studio 14 2015 Win64" \
-DLIBUSB_INCLUDE_DIR=c:\libusb-1.0.21\libusb \
-DLIBUSB_LIBRARIES=c:\libusb-1.0.21\MS64\dll\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 \
-DFFTW_INCLUDES=C:\fftw-3.3.5-dll64 \
-DFFTW_LIBRARIES=C:\fftw-3.3.5-dll64\libfftw3f-3.lib
cmake ../ -G "Visual Studio 16 2019" -A "x64" ^
-DLIBUSB_INCLUDE_DIR=C:\dev\hackrf_libs\libusb-1.0.24\include\libusb-1.0 ^
-DLIBUSB_LIBRARIES=C:\dev\hackrf_libs\libusb-1.0.24\VS2019\MS64\dll\libusb-1.0.lib ^
-DTHREADS_PTHREADS_INCLUDE_DIR=C:\dev\hackrf_libs\pthreads-w32-2-9-1-release\Pre-built.2\include ^
-DTHREADS_PTHREADS_WIN32_LIBRARY=C:\dev\hackrf_libs\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\pthreadVC2.lib ^
-DFFTW_INCLUDES=C:\dev\hackrf_libs\fftw-3.3.5-dll64 ^
-DFFTW_LIBRARIES=C:\dev\hackrf_libs\fftw-3.3.5-dll64\libfftw3f-3.lib
cmake ../ -G "Visual Studio 17 2022" -A "x64" ^
-DLIBUSB_INCLUDE_DIR=C:\dev\hackrf_libs\libusb-1.0.24\include\libusb-1.0 ^
-DLIBUSB_LIBRARIES=C:\dev\hackrf_libs\libusb-1.0.24\VS2019\MS64\dll\libusb-1.0.lib ^
-DTHREADS_PTHREADS_INCLUDE_DIR=C:\dev\hackrf_libs\pthreads-w32-2-9-1-release\Pre-built.2\include ^
-DTHREADS_PTHREADS_WIN32_LIBRARY=C:\dev\hackrf_libs\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\pthreadVC2.lib ^
-DFFTW_INCLUDES=C:\dev\hackrf_libs\fftw-3.3.5-dll64 ^
-DFFTW_LIBRARIES=C:\dev\hackrf_libs\fftw-3.3.5-dll64\libfftw3f-3.lib
msbuild -m HackRF.sln
The -m
switch enables parallel builds for faster total build times.