问题
I have downloaded assimp source code. How to import assimp to Xcode project - ARToolKit5 downloaded from ARToolkit official website? I am trying to load external models - made by blender,maya,3dmax - to this project. (ps: I am a beginner of Xcode, so please explain it in detail. ) Thank you! :)
回答1:
I know it's late, but it might benefit someone else.
Here are the steps :
Download and extract the source code from(for version 3.3.1) https://github.com/assimp/assimp/archive/v3.3.1.zip
Download CMake Gui, and select source as the folder you got after extracting above. Create a build folder inside the assimp folder, and select it to be the build directory.
Select Configure and select XCode. Then Click on generate to generate build files in the build folder.
Open Assimp.xcodeproj file in build folder in XCode and build it.
Now you have got the library and include files. The library files are located in assimp(which you extracted)/build/code/Debug, and the include files are at two locations, one set is at assimp/include and other at assimp/build/include. Make a separate folders library and include at your desired location and copy all these files in the corresponding folders you created.
Now open your project in XCode. Select your project from the left panel, and click on Build phases, click on + inside 'Link Binary with libraries', and click on add other, now select the libassimp.4.0.1.dylib(select the latest version) file.
Now click on Build settings, inside search paths, add your include folder(which you created) to the header search paths, and the library folder to library search paths.
If you followed the steps correctly, you could use these statements inside your project
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
来源:https://stackoverflow.com/questions/41359551/how-to-import-assimp-to-my-my-xcode-project