Saving header directory structure in Xcode for static library

I am developing a static library in C ++ using Xcode. I have an installation directory where it copies all my public header files, but when I compile it, it just copies all the headers into one directory. Is there any way to tell Xcode to keep the directory structure of my header files? Thanks in advance!

+6
source share
2 answers

I also needed to keep the directory structure of the header files for the C ++ library project, and I finally managed to do this. This is ridiculously difficult with Xcode compared to a simple task. The key is to first create “folder links”, then copy the header folders in the additional build phase, and then remove the .c / .cpp files from these exported header folders with a script, since Xcode will not only copy the .h files.

I wrote a blog post here on how to achieve all this because it is more difficult. You can also check out an example Xcode project in which I have a github bank.

+1
source

When you add files to your project, you need to select the next option in the additional window “Create folder links for any added folders”. And then all your files will have a fixed path for your files and retain the structure after compilation.

-1
source

Source: https://habr.com/ru/post/905279/


All Articles