2016-12-25 105 views
0

我正在嘗試使用深度傳感器並嘗試獲取灰度圖像並使用OpenCV進行顯示。我可以從深度傳感器訪問數據,沒有任何問題。但我得到以下錯誤,當我嘗試以包括的CMakeLists.txt OpenCV的一部分:嘗試添加opencv庫時發生CMake錯誤

CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_PREFIXES 
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. 
Missing variable is: 
CMAKE_FIND_LIBRARY_SUFFIXES 
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message): 
    Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found suitable exact 
    version "8.0") 
Call Stack (most recent call first): 
    /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) 
    /usr/share/cmake/Modules/FindCUDA.cmake:958 (find_package_handle_standard_args) 
    /usr/local/share/OpenCV/OpenCVConfig.cmake:67 (find_package) 
    /usr/local/share/OpenCV/OpenCVConfig.cmake:86 (find_host_package) 
    share/royale-config.cmake:38 (find_package) 
    CMakeLists.txt:6 (find_package) 

我的CMakeLists.txt如下所示:

cmake_minimum_required(VERSION 2.8) 

set(CMAKE_PREFIX_PATH "share") 

find_package(royale REQUIRED) 

find_package(OpenCV REQUIRED) 

link_directories(${royale_LIB_DIR}) 

project (depthDataCallBack) 

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) 

add_executable(depthDataCallBack depthDataCallBack.cpp) 

target_link_libraries(depthDataCallBack "${royale_LIBS}") 

target_link_libraries(depthDataCallBack ${OpenCV_LIBS}) 

我是新來的CMake。所以,任何和所有的幫助將不勝感激。謝謝!

回答

2

project()呼叫應該優先於大多數其他命令調用。

通常,只有cmake_minimum_required()和變量賦值可能會在project()之前出現。

正確:

cmake_minimum_required(VERSION 2.8) 

set(CMAKE_PREFIX_PATH "share") 

project (depthDataCallBack) 

find_package(royale REQUIRED) 
find_package(OpenCV REQUIRED) 
link_directories(${royale_LIB_DIR}) 

... 
+0

太謝謝你了!有效! –

相關問題