[CMake] FFTW_FOUND is true even if it is not found?

David Doria daviddoria at gmail.com
Mon Aug 22 16:20:56 EDT 2011


> From just that module, I do not have a reasonable explanation...
>
> What does this code output, when placed:
> (1) directly after the find_package(FFTW) call?
> (2) at the very bottom of your CMakeLists.txt file...?
>
>  message(STATUS "FFTW_INCLUDE_DIR='${FFTW_INCLUDE_DIR}'")
>  message(STATUS "FFTW_LIBRARIES='${FFTW_LIBRARIES}'")
>  message(STATUS "FFTW_FOUND='${FFTW_FOUND}'")
>  message(STATUS "CMAKE_MODULE_PATH='${CMAKE_MODULE_PATH}'")

Bah, I was not using CMake syntax for the conditional:

if(NOT ${FFTW_FOUND})

vs

if(!${FFTW_FOUND})
  MESSAGE(FATAL_ERROR "FFTW3 was not found!")
endif()

(shouldn't that throw an "invalid syntax" error? What is "!" in CMake?)

> Is "find_package(FFTW)" exactly how you call it?

My call is:
find_package(FFTW REQUIRED)

Shouldn't this produce the same error I am manually trying to produce
above (since it is marked as required but not found)?

Thanks,

David


More information about the CMake mailing list