I'm having a few problems creating a podspec file to extract a C++ library from an iOS application.
Actually my main problem are headers, my C++ library depends on rapidjson that is included inside the library repository in an ext_inc directory ( the files are something like ${PROJECT_SOURCE_PATH}/ext_inc/rapidjson/*h).
If I include it in source files like this:
s.source_files = utils/*{cpp,h}', 'handler/*{cpp,h}','ext_inc/**/*h'
When I try to compile the library with:
pod lib lint --verbose report-base.podspec
I get errors like this:
../utils/json_serializer.h:8:10: fatal error: 'rapidjson/prettywriter.h' file not found
The errors are caused by the fact that headers are included as:
#include "rapidjson/prettywriter.h"
The compilation goes on if I change that to:
#include "prettywriter.h"
... but that is the wrong way to include an external library like rapidjson and it's not portable at all (the same library is also the core of the android application, so I should remain as crossplatform as possible).
I tried to avoid this problem using the podfile private_header_path and adding a xcconfig with the key:
'HEADER_SEARCH_PATHS' => 'ext_inc'
... but nothing works.
For what I have understood cocoapods build an xcode project from the podspec file, and uses module mapping to map all the source and header files like if they are all in a single directory, and in this context the fact that my headers include a path break everything... there is a way to "save" in the module map an header with a path?