我正在使用 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/