Skip to content

Commit cb7c4fe

Browse files
committed
Cleanup CMake generation warnings
Warnings related to the `add_custom_command` calls that did not have commands, but were being just used to output messages. Instead, these messages are being output via the CMake -E echo command as the final command in the original targets.
1 parent ea9e8b7 commit cb7c4fe

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

code-coverage.cmake

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -465,17 +465,12 @@ function(target_code_coverage TARGET_NAME)
465465
${GENHTML_PATH} -o
466466
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}
467467
${COVERAGE_INFO}
468+
COMMAND
469+
${CMAKE_COMMAND} -E echo
470+
"Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}/index.html in your browser to view the coverage report."
468471
DEPENDS ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME})
469472
endif()
470473

471-
add_custom_command(
472-
TARGET ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
473-
POST_BUILD
474-
COMMAND ;
475-
COMMENT
476-
"Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}/index.html in your browser to view the coverage report."
477-
)
478-
479474
# AUTO
480475
if(target_code_coverage_AUTO)
481476
if(NOT TARGET ccov)
@@ -692,16 +687,10 @@ function(add_code_coverage_all_targets)
692687
ccov-all
693688
COMMAND ${GENHTML_PATH} -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged
694689
${COVERAGE_INFO} -p ${CMAKE_SOURCE_DIR}
690+
COMMAND
691+
${CMAKE_COMMAND} -E echo
692+
"Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged/index.html in your browser to view the coverage report."
695693
DEPENDS ccov-all-capture)
696-
697694
endif()
698-
699-
add_custom_command(
700-
TARGET ccov-all
701-
POST_BUILD
702-
COMMAND ;
703-
COMMENT
704-
"Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged/index.html in your browser to view the coverage report."
705-
)
706695
endif()
707696
endfunction()

dependency-graph.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ function(gen_dep_graph OUTPUT_TYPE)
8686
COMMAND
8787
${DOT_EXE} -T${OUTPUT_TYPE}
8888
${CMAKE_CURRENT_BINARY_DIR}/graphviz/${TARGET_NAME}.dot -o
89-
${OUT_DIR}/${TARGET_NAME}.${OUTPUT_TYPE})
90-
91-
add_custom_command(
92-
TARGET ${TARGET_NAME}
93-
POST_BUILD
94-
COMMAND ;
95-
COMMENT
89+
${OUT_DIR}/${TARGET_NAME}.${OUTPUT_TYPE}
90+
COMMAND
91+
${CMAKE_COMMAND} -E echo
9692
"Dependency graph for ${TARGET_NAME} generated and located at ${OUT_DIR}/${TARGET_NAME}.${OUTPUT_TYPE}"
9793
)
9894

0 commit comments

Comments
 (0)