C:\blah\duh\bin\Android>"C:\Program Files (x86)\CMake\bin\cmake.exe" --build . --target SysTest --use-stderr -- -j 8 我有上面的CMake构建命令。我知道--build .将从当前目录中的Makefile构建。但是选项--target SysTest和-j 8做什么呢?这是--build的CMake文档,但我承认,我不了解--target的用法。
--build <dir>
Build a CMake-generated project binary tree.
This abstracts a native build tool’s command-line interface with the following options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Ignored. Behavior is default in CMake >= 3.0.
-- = Pass remaining options to the native tool.发布于 2014-09-18 03:59:51
如果我有
add_executable(hello hello.cpp)
add_executable(goodbye goodbye.cpp)然后,CMake为每个可执行文件创建“构建目标”。它还创建其他构建目标,例如构建所有内容的“all”构建目标。
默认情况下,如果未指定目标,则执行'all‘目标,这意味着hello和告别都是构建的。
如果您只想构建其中一个,则可以指定要构建的目标。
https://stackoverflow.com/questions/25896657
复制相似问题