I have a CI pipeline which generates an .exe
alongside the needed dll
. I’m trying to package the whole thing into a tar.gz for the sake of practicality.
so I tried to declare to following cmake code :
file(
GLOB
DLL_FILES
${PROJECT_BINARY_DIR}/*.exe
${PROJECT_BINARY_DIR}/*.dll)
add_custom_target(
generate_tar
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
COMMAND tar czf "output.tar.gz" ${DLL_FILES})
Thus, at the end of my pipeline, I’m calling generate_tar
which fails with the following message : tar: no files or directories specified
, which is explainable because file
command is ran when this CMake file is included, at the begining, when my project has not been generated yet.
So I’d like to create this DDL_FILES
variable when calling add_custom_target
but I can’t find tips on how to do this properply (i’m fairly to CMake use).