Open pltanguay opened 4 weeks ago
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
)
`
https://github.com/Dav1dde/glad/blob/01277173613cdb0339f58de9f6d090474ddbeab2/cmake/GladConfig.cmake#L242
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:
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.