当前位置 : 主页 > 手机开发 > 其它 >

CMake自定义目标的依赖关系图

来源:互联网 收集:自由互联 发布时间:2021-06-22
CMake的–graphviz选项是否应该依赖于自定义目标? 示例CMakeLists.txt文件: cmake_minimum_required(VERSION 2.8)add_executable(target0 test.cpp)add_dependencies(target0 target1)add_custom_target(target1 ALL COMMAND echo he
CMake的–graphviz选项是否应该依赖于自定义目标?

示例CMakeLists.txt文件:

cmake_minimum_required(VERSION 2.8)
add_executable(target0 test.cpp)
add_dependencies(target0 target1)
add_custom_target(target1 ALL
  COMMAND echo hello
)

输出文件“cmake –graphviz = test.dot.”将会:

digraph GG {
node [
  fontsize = "12"
];
    "node3" [ label="target0" shape="house"];
}

没有任何目标1的痕迹.

CMake manual明确指出:

–graphviz=[file]

Generate a graphviz input file that will contain all the library and executable dependencies in the project. See the documentation for CMakeGraphVizOptions.cmake for more details.

因此,据我所知,您的自定义目标既不是 – 也不是库,也不是可执行文件可以包含在结果图中.

网友评论