I want all the files with a particular extension in CMake in a directory. These extension files are generated post running the build. I tried
file(GLOB_RECURSE GCOV_OBJECTS $ENV{OUTPUT_UT_DIR} *Test.cpp.o)
But this is getting executed before running the build. I want something like this
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND my_command_to_get_all_desired_files
Using file command inside add_custom_command
is giving me a syntax error. Not sure how to proceed from here.