我正在从GitHub(subdivision-regression)下载此代码,并且按照说明进行操作:
To build doosabin_regression:
Run CMake with an out of source build.
Set COMMON_CPP_INCLUDE_DIR to the full path to rstebbing/common/cpp.
Set DOOSABIN_INCLUDE_DIR to the full path to rstebbing/subdivision/cpp/doosabin/include.
Set Ceres_DIR to the directory containing CeresConfig.cmake.
Set GFLAGS_INCLUDE_DIR, GFLAGS_LIBRARY and RAPID_JSON_INCLUDE_DIR. (Add -std=c++11 to CMAKE_CXX_FLAGS if compiling with gcc.)
Configure.
Build.
我已经编辑了CMakeLists.txt
文件以放置正确的路径。然后我创建了一个名为subdivision-regression-bin
的新目录并运行:
cmake ../subdivision-regression/src
它完成并显示:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hert5584/RStebbing/subdivision-regression-bin
但是,当我尝试运行示例代码时,它找不到CMakeLists.txt
中列出的文件(我知道它们是正确的路径,否则CMake无法运行)。
我尝试跑步:
sudo make install
但是出现以下错误:
make: *** No rule to make target 'install'. Stop.
有什么想法为什么不起作用?以上步骤是否已配置并构建文件?
答案 0 :(得分:1)
要理解的有序CMake习惯用法是:
看看此resource,了解有关 configure 和 generate 阶段的信息。
您似乎没有执行设置CMake缓存变量的步骤。对于这些,您必须使用CMake命令行options(特别是-D
)。因此,像这样运行CMake来设置所有六个变量:
cmake -DCOMMON_CPP_INCLUDE_DIR=/rstebbing/common/cp -DDOOSABIN_INCLUDE_DIR=...[More CMake Cache variables]... ../subdivision-regression/src
要进行构建,请尝试仅运行make
而不使用sudo
或install
:
make