CMake无法找到" FindLibUSB.cmake"在CMAKE_MODULE_PATH尽管它在那里

时间:2016-07-26 19:44:24

标签: cmake libusb libusb-1.0

在我的CMakelists.txt文件中,我指定:

set (CMAKE_MODULE_PATH “${<ProjectName>_SOURCE_DIR}/cmake_modules”)

在我的项目根目录中,有一个名为cmake_modules的子目录,其中有一个名为FindLibUSB.cmake的文件,但是当我运行cmake时,我收到以下错误:

By not providing "FindLibUSB.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "LibUSB", but CMake did not find one.

为什么无法找到该文件?在我看来,它的名字正确,它位于正确的位置,cmake知道在哪里看。

这里是CMakeLists.txt:

cmake_minimum_required (VERSION 2.8.12.1)

project (Connected-Room)

set (Connected-Room_VERSION_MAJOR 0)
set (Connected-Room_VERSION_MINOR 1)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

list (APPEND CMAKE_PREFIX_PATH "/Users/<username>/kinect2/libfreenect2/build/")
list (APPEND CMAKE_MODULE_PATH “${Connected-Room_SOURCE_DIR}/cmake_modules”)

Message ("CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH})

find_package (LibUSB REQUIRED)
find_package (OpenCV REQUIRED)
find_package (Boost COMPONENTS system REQUIRED)
find_package (libfreenect2 REQUIRED)

0 个答案:

没有答案