Skip to content

Commit 832fe65

Browse files
author
David Graeff
committed
Buildsystem: Add the fftw lib to the repository for windows users
1 parent 6dddef1 commit 832fe65

File tree

5 files changed

+28
-15
lines changed

5 files changed

+28
-15
lines changed

cmake/fftw-3.3.5-dll32.zip

2.49 MB
Binary file not shown.

cmake/fftw-3.3.5-dll64.zip

2.97 MB
Binary file not shown.

cmake/fftw_on_windows.cmake

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ macro( CheckExitCodeAndExitIfError MSG)
99
endif()
1010
endmacro( CheckExitCodeAndExitIfError )
1111

12+
set(filename "${CMAKE_BINARY_DIR}/fftw.zip")
13+
1214
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
13-
message("Download FFTW for mingw32")
15+
message("Download/Extract FFTW for 32bit")
1416
if (NOT EXISTS "${CMAKE_BINARY_DIR}/fftw.zip")
15-
file(DOWNLOAD "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll32.zip" "${CMAKE_BINARY_DIR}/fftw.zip" SHOW_PROGRESS)
17+
# file(DOWNLOAD "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll32.zip" "${filename}" SHOW_PROGRESS)
18+
set(filename "${CMAKE_CURRENT_LIST_DIR}/fftw-3.3.5-dll32.zip")
1619
endif()
1720
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
18-
message("Download FFTW for mingw64")
21+
set(LIBEXE_64 "/machine:x64")
22+
message("Download/Extract FFTW for 64bit")
1923
if (NOT EXISTS "${CMAKE_BINARY_DIR}/fftw.zip")
20-
file(DOWNLOAD "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip" "${CMAKE_BINARY_DIR}/fftw.zip" SHOW_PROGRESS)
24+
# file(DOWNLOAD "ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip" "${filename}" SHOW_PROGRESS)
25+
set(filename "${CMAKE_CURRENT_LIST_DIR}/fftw-3.3.5-dll64.zip")
2126
endif()
2227
else()
2328
message(FATAL_ERROR "Target architecture not known")
@@ -26,7 +31,7 @@ endif()
2631
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/fftw")
2732

2833
execute_process(
29-
COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_BINARY_DIR}/fftw.zip
34+
COMMAND ${CMAKE_COMMAND} -E tar xzf "${filename}"
3035
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/fftw"
3136
RESULT_VARIABLE ExitCode
3237
)
@@ -35,10 +40,12 @@ CheckExitCodeAndExitIfError("tar")
3540
get_filename_component(_vs_bin_path "${CMAKE_LINKER}" DIRECTORY)
3641

3742
execute_process(
38-
COMMAND "${_vs_bin_path}/lib.exe" /machine:x64 /def:${CMAKE_BINARY_DIR}/fftw/libfftw3-3.def /out:${CMAKE_BINARY_DIR}/fftw/libfftw3-3.lib
43+
COMMAND "${_vs_bin_path}/lib.exe" ${LIBEXE_64} /def:${CMAKE_BINARY_DIR}/fftw/libfftw3-3.def /out:${CMAKE_BINARY_DIR}/fftw/libfftw3-3.lib
3944
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/fftw"
45+
OUTPUT_VARIABLE OutVar
46+
ERROR_VARIABLE ErrVar
4047
RESULT_VARIABLE ExitCode)
41-
CheckExitCodeAndExitIfError("lib")
48+
CheckExitCodeAndExitIfError("lib.exe: ${OutVar} ${ErrVar}")
4249

4350
target_link_libraries(${PROJECT_NAME} "${CMAKE_BINARY_DIR}/fftw/libfftw3-3.lib")
4451
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_BINARY_DIR}/fftw")

docs/build.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ Please adjust the path to Qt5. You can find the path with the command:
3737
3838
### [Windows](#windows)
3939

40-
Run the **CMake GUI** program and select the source directory, build directory and your compiler.
41-
If your compiler is for example Visual Studio, cmake will generate a Visual Studio Project and solution file (\*.sln).
42-
Open the project and build it. If you use an IDE that has inbuild support for cmake projects like QtCreator,
43-
you can just open and build this project.
40+
We highly recommend to use QtCreator to build this software. All reported issues regarding other IDEs
41+
will be closed as invalid!
42+
43+
* Open the project in QtCreator
44+
* Compile the software
45+
46+
Hints for Visual Studio 2015/2017 users:
47+
* Install the right Qt package that matches your Visual Studio installation.
48+
* Build for 64bit. 32bit builds theoretically work, but you are on your own then.
49+
* Use the **CMake GUI** to setup all required Qt include and library paths.
4450

4551
Microsoft Windows needs an installed driver for every usb device:
4652

openhantek/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ else()
4343
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<CONFIG:RELEASE>:-fno-rtti>")
4444
endif()
4545

46-
if(WIN32)
47-
include(../cmake/fftw_on_windows.cmake)
48-
include(../cmake/libusb_on_windows.cmake)
49-
else()
46+
include(../cmake/fftw_on_windows.cmake)
47+
include(../cmake/libusb_on_windows.cmake)
48+
49+
if(NOT WIN32)
5050
find_package(libusb REQUIRED)
5151
target_include_directories(${PROJECT_NAME} PRIVATE ${LIBUSB_INCLUDE_DIRS})
5252
target_link_libraries(${PROJECT_NAME} ${LIBUSB_LIBRARIES})

0 commit comments

Comments
 (0)