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

はありがとうございました!出来た! –

関連する問題