Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails in cmake 3.31 #89

Open
phlptp opened this issue Nov 16, 2024 · 1 comment
Open

fails in cmake 3.31 #89

phlptp opened this issue Nov 16, 2024 · 1 comment

Comments

@phlptp
Copy link

phlptp commented Nov 16, 2024

The coverage methods fail in cmake 3.31 due to policy CMP0175

All add_custom_command calls like

add_custom_command(
    TARGET ${Coverage_NAME}
    POST_BUILD
    COMMAND ;
    COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml.")
endfunction() # setup_target_for_coverage_gcovr_xml

generate an error of the form
At least one COMMAND must be given.

These custom commands which seem to be for comment only should be integrated into the TARGET through separate commands or the comment made into a command.

@carlocorradini
Copy link

I've solved by faking the command:

add_custom_command(
    TARGET ${Coverage_NAME}
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E true # Always return 0
    COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml.")
endfunction() # setup_target_for_coverage_gcovr_xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants