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

Being able to not "echo" Cleaning, Generating, Writing when using 'QUIET' #491

Open
pltanguay opened this issue Sep 27, 2024 · 1 comment

Comments

@pltanguay
Copy link

pltanguay commented Sep 27, 2024

add_custom_command(

In the GladConfig.cmake file, there should be a flag that can be set by the user to not 'echo' these info when using the 'QUIET' mode:

  • Cleaning ...
  • Generating ...
  • Writing ...

image

Also, there should be a flag allowing not to produce the 'args.txt'

In the case a user would like a Quiet build (like myself), there are still messages outputing to the console. There should not be.

@pltanguay
Copy link
Author

pltanguay commented Sep 28, 2024

Here is my suggestion for the "echo" commands:
`

# echo commands if logging is enabled
set(ECHO_CLEANING   "")
set(ECHO_GENERATING "")
set(ECHO_WRITING    "")

if (NOT GG_QUIET)
    list(APPEND ECHO_CLEANING   "echo Cleaning ${GLAD_DIR}")
    list(APPEND ECHO_GENERATING "echo Generating with args ${GLAD_ARGS}")
    list(APPEND ECHO_WRITING    "echo Writing ${GLAD_ARGS_PATH}")
else()
    set(COMMAND ${CMAKE_COMMAND} -E echo "Condition is false")
endif()

# add make custom target
add_custom_command(
    OUTPUT ${GLAD_FILES} ${GLAD_ARGS_PATH}
    COMMAND "${ECHO_CLEANING}"
    COMMAND ${CMAKE_COMMAND} -E remove_directory ${GLAD_DIR}
    COMMAND ${CMAKE_COMMAND} -E make_directory   ${GLAD_DIR}
    COMMAND "${ECHO_GENERATING}"
    COMMAND ${Python_EXECUTABLE} -m glad ${GLAD_ARGS}
    COMMAND "${ECHO_WRITING}"
    COMMAND echo ${GLAD_ARGS} > ${GLAD_ARGS_PATH}
    WORKING_DIRECTORY $<$<BOOL:${GLAD_SOURCES_DIR}>:${GLAD_SOURCES_DIR}>
    COMMENT "${TARGET}-generate"
    USES_TERMINAL
    )

`

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

1 participant