[英]CMake find_package not finding Find<package>.cmake
我制作並安裝了aruco庫,該庫將Findaruco.cmake文件放在/ usr / local / lib / cmake目錄中。 在我的CMakeLists.txt文件中
...
find_package(aruco REQUIRED)
它總是返回標准錯誤
By not providing "Findaruco.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "aruco", but
CMake did not find one.
Could not find a package configuration file provided by "aruco" with any of
the following names:
arucoConfig.cmake
aruco-config.cmake
Add the installation prefix of "aruco" to CMAKE_PREFIX_PATH or set
"aruco_DIR" to a directory containing one of the above files. If "aruco"
provides a separate development package or SDK, be sure it has been
installed.
我已將環境變量$ CMAKE_PREFIX_PATH設置為以下各項,但均無效
/usr/local
/usr/local/lib
/usr/local/lib/cmake
唯一有效的方法是在CMakeLists中設置以下內容
set(CMAKE_MODULE_PATH /usr/local/lib/cmake)
我不確定自己在做什么錯
嘗試設置名為CMAKE_PREFIX_PATH
CMake變量,而不是環境一。 在cmake
調用期間使用-D標志:
cmake -D CMAKE_PREFIX_PATH=/usr/local/lib <path to source or build dir>
但是,在AFAIR中,CMake應該將/usr/local
前綴作為其默認行為。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.