FPHSA: Regression causes "Could NOT find CUDA: Found unsuitable version "8.0", but required is exact version "8.0""
I am on Ubuntu 16.04, GCC 5.4, latest CMake.
How to reproduce the problem:
CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(Example)
set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/main.cpp)
find_package( CUDA 8.0 EXACT REQUIRED )
cuda_add_executable(${PROJECT_NAME} ${PROJECT_SRCS})
main.cpp can be whatever, after
mkdir build
cd build
cmake ..
CMake Error at /usr/local/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find CUDA: Found unsuitable version "8.0", but required is exact
version "8.0" (found /usr/local/cuda)
Call Stack (most recent call first):
/usr/local/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.9/Modules/FindCUDA.cmake:1042 (find_package_handle_standard_args)
CMakeLists.txt:9 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/test/build/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/test/build/CMakeFiles/CMakeError.log".
However, if I do git checkout 2581ab4
(the commit before d4f58a9c) and rebuild cmake again, the cmake error goes away. I could remove the EXACT
and it will also work but I discovered this problem with I was linking my project to OpenCV, in OpenCVConfig.cmake they have the EXACT
keyword in it which is causing cmake configuration errors.
By investigating commit d4f58a9c I am unable to understand which line is causing the break. Can someone look into it and fix it?