R.Falque
R.Falque

Reputation: 944

How to use FFTW with cmake on windows?

I am building my project for Visual Studio with CMake. I used this lines in my CMakeList.txt to include FFTW3.

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

I got this error from 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:/...

I think I did not install fftw properly. I got .dll .lib and .h files in a folder but I don't know how to explain to CMake where is the library.

Upvotes: 2

Views: 4067

Answers (1)

JonnyRo
JonnyRo

Reputation: 1894

Specify additional paths for find_library to use.

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

You will need to include the path to your custom FFTW installation.

A similar technique will need to be used when you use find_file to locate the headers

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

Upvotes: 2

Related Questions