Hello,
I am downloading some header files from a remote URL and unzipping them using FetchContent. This works as expected, except for the fact that the zip files directory structure isn’t being kept the same.
For example, if I take a look at the zip file I am downloading in 7zip, the directory structure looks like this:
- foo/
- bar/
- example.h
But when using FetchContent like so:
FetchContent_Declare(
package_headers
URL ${header_url}
)
FetchContent_MakeAvailable(package_headers)
The directory structure ends up like this
- build/
- desktop_debug_shared
- _deps
- package_headers-src
- bar/
- example.h
This only seems to happen if the zip has only a folder in the top level dir and nothing else.
I would like to keep the top-level folder to keep the include path the same.
Any help is appreciated!