execute_process: OUTPUT_FILE filled but OUTPUT_VARIABLE empty
With cmake version 3.23.1 on unix I have found this:
I have:
execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${GIT_PATH} OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/commit_id OUTPUT_VARIABLE var_commit_id RESULT_VARIABLE res)
After this is executed successfully, I got output_file (commit_id) with the expected content. However, var_commit_id is empty!