I had CUDA 7.5 installed before and have just removed it and installed CUDA 8.0. After doing that, cmake has started giving error on any kind of compilation , giving these errors:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find CUDA: Found unsuitable version "8.0", but required is exact version "7.5" (found /usr/local/cuda-8.0) Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args) /usr/local/share/OpenCV/OpenCVConfig.cmake:48 (find_package) /usr/local/share/OpenCV/OpenCVConfig.cmake:291 (find_host_package) CMakeLists.txt:3 (find_package) -- Configuring incomplete, errors occurred! See also "/home/cortana/Desktop/app/build/CMakeFiles/CMakeOutput.log". See also "/home/cortana/Desktop/app/build/CMakeFiles/CMakeError.log". This error came up on compiling some opencv code. Considering that on not using cmake, the code compiles alright, opencv isn't broken. But cmake is showing such behaviour. Also, I am not even using cuda, so I dont know how its coming up. How can I remove this problem?
Edit: Here is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8) PROJECT (app) find_package(OpenCV REQUIRED ) set( SRC code.cpp ) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include ) link_directories( ${CMAKE_BINARY_DIR}/bin) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) add_executable( {PROJECT_NAME} ${SRC} ) target_link_libraries( {PROJECT_NAME} ${OpenCV_LIBS} )