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
示例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.
因此,据我所知,您的自定义目标既不是 – 也不是库,也不是可执行文件可以包含在结果图中.