I'm trying to compile libcpr for iOS. I have built cpr using CMake using the Xcode generator. This has generated an .xcodeproj I have imported (read drag&drop) into my Xcode project. The problem lies when I try to import the library headers, they are not found:
// currently with quote notation but also tried with bracket notation
#import "cpr/cpr.h" // NOT FOUND
You can see a more detailed steps on how I built the project in the respective github issue.
I can see the subproject contains not only the headers for libcpr, but also for libcurl and zlib (which are also necessary):
All the information I can find, regarding Xcode and library headers, seems to be some manual steps like copying the header files, which is at the very least prone to errors. Another option seems to be modifying the User Header Search Paths property in the build settings. I tried setting the User Header Search Paths and Header Search Paths to point to the folders:
I have tried many values in there: Libraries/**, $(PROJECT_DIR)/../cpr/build (I have added the libcpr repo as a submodule, so that's the build output folder) and many other variations. Nothing works.
Here is the repo with my current progress. To generate the artifacts:
- Initialize the submodule
cd cprmkdir build && cd build && cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED -DENABLE_STRICT_TRY_COMPILE=ON -DDEPLOYMENT_TARGET=13.0 -DBUILD_SHARED_LIBS=OFF- Before compilation you will have to fix an implicit conversion on one header file (cpr/include/body.h just add (int) in the line where the error pops up)
cmake --build . --config Release
That generates the artifact and you should be able to open the .xcodeworkspace file in the iOS folder from the root repo.
Any Help would be greatly appreciated!

