2016-12-25 98 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

太谢谢你了!有效! –

相关问题