有人可以用 CMake 文件扩展 'configure' 和 'build' 的含义吗

Can someone expand what is meant by 'configure' and 'build' with CMake files

我正在从 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.

知道为什么这不起作用吗?以上步骤是否已经配置并构建了文件?

要理解的有序CMake习惯用法是:

  1. 配置步骤
  2. Generate 步骤(这通常包含在 Configure 步骤中,没有明确提及,如本例所示。)
  3. Build 步骤(实际上你 compile/link 你的代码变成了 libraries/executables)

查看此 resource 了解有关 configuregenerate 阶段的信息。

您似乎没有执行设置 CMake 缓存变量的步骤。对于这些,您必须使用 CMake 命令行 options(特别是 -D)。所以 运行 CMake 像这样设置所有六个变量:

cmake -DCOMMON_CPP_INCLUDE_DIR=/rstebbing/common/cp -DDOOSABIN_INCLUDE_DIR=...[More CMake Cache variables]...  ../subdivision-regression/src

对于构建,尝试只 运行ning make 没有 sudoinstall:

make