Execute Command Post Build - CMakeList.txt

Can someone confirm if CMake add_custom_target and add_custom_command work with VS-Code and the PlatformIO extension?

I am trying to trigger post-build events in the CMakeList.txt file for components instead of using a Python or Powershell script triggered using the extra_scripts parameter in the pio ini file. However, they are not triggering when compiled with VS-Code and the PlatformIO extension. Thanks in advance.

add_custom_target(
    cmp_reg_sync ALL
    COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/stg/pio_lib_sync.py OK
    COMMENT "python testing with add_custom_command..."
)
add_dependencies( ${COMPONENT_LIB} cmp_reg_sync )


add_custom_command(
    TARGET ${COMPONENT_LIB}
    POST_BUILD
    COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/stg/pio_lib_sync.py OK
    COMMENT "python testing with add_custom_command..."
)

I can confirm that Visual Studio Code with the ESP-IDF extension seems to have the same issue where custom CMake commands are not getting asserted at specified build milestones.

Additional details are available here: VSC + ESP-IDF CMake custom commands example.