加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 04:51:45 所属栏目:百科 来源:网络整理
导读: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
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.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读