2

我正在使用 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 解释库在哪里。

4

1 回答 1

2

指定要使用的 find_library 的其他路径。

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

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

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

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

于 2013-08-27T18:18:40.133 回答