How to copy all headers from a C++ project with premake

Viewed 1321

I have a C++ project with its source files (.cpp and .h files) in a directory called src and its subdirectories. I want, once my project is compiled, to copy all the header files from this source folder into another directory, maintaining the folderstructure of src.

I have tried to copy these files with post-build commands:

postbuildcommands
{
    "{COPY} src/*.h include"
}

and

postbuildcommands
{
    "{COPY} src/**.h include"
}

But these only copy the .h files directly in src and not those in subdirectories. For example, this

src
+-- a.h
+-- a.cpp
+-- sub
|   +-- b.h
|   +-- b.cpp

becomes

include
+-- a.h

instead of

include
+-- a.h
+-- sub
|   +-- b.h
1 Answers
Related