build - 如何在 Windows 上将 FFTW 与 cmake 一起使用?

标签 build cmake fftw

我正在使用 CMake 为 Visual Studio 构建项目。我在 CMakeList.txt 中使用了这一行来包含 FFTW3。

find_library(FFTW_LIBRARY
     NAMES fftw3 fftw)
set(FFTW_LIBRARIES "${FFTW_LIBRARY}")

我从 CMake 收到此错误:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FFTW_LIBRARY
    linked by target "windows_SHT" in directory C:/...

我想我没有正确安装fftw。我在文件夹中有 .dll .lib 和 .h 文件,但我不知道如何向 CMake 解释该库在哪里。

最佳答案

指定 find_library 使用的其他路径。

参见:http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_library

您需要包含自定义 FFTW 安装的路径。

当您使用 find_file 来定位 header 时,需要使用类似的技术

http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_file

关于build - 如何在 Windows 上将 FFTW 与 cmake 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18178641/

相关文章:

sqlite - 使用 CLion 和 CMAKE 的 sqlite3 函数的 C/C++ 未定义引用

CMake 目标取决于已安装的目标

c++ - 将 cmake 项目与 Qt5 链接时部署 icu 库

c++ - 解释fftw的.wav数据

build - CMake 中的第三方库

c++ - 处理具有多种构建类型的介子构建选项

c++ - QVector 总是推回 0?

c++ - 使用 Eigen 和 FFTW 进行二维傅里叶变换

java - 由于 "active git repository",Eclipse Java 未构建

java - 进行 cordova 平台更新后,Android 目标发生更改