![]() ![]() Copy assimp.lib from build/code/Release to lib folder of our Sample project.When you have successfully built Assimp binaries, you can do the following steps: When everything is ok (I hope it is), you should see a message in Visual Studio console: Now select the build configuration to Release and platform to Win32 and build the project (press F7 or choose Build->Build solution). Then, right click on the assimp project and select Set as StartUp project. If you generated Visual Studio solution files using one of the above methods, go to the build folder and open Assimp.sln. CMake will save them inside the build folder. Now you can click on the Generate button to generate Visual Studio solution files. When configuration step has completed, make sure that LIBRARY_SUFFIX is empty: Now click on the Configure button and select the generator for our project. Then, you should have something like this: I think that these boxes are self-explanatory. You should see a window similar to this one: Generated Visual Studio solution files should be inside the build folder. Simply open command line tool inside the newly created build directory and type:Ĭmake -G "Visual Studio 15" -DLIBRARY_SUFFIX="". ![]() ![]() Here, I will show how to use both approaches. To create Visual Studio solution files using CMake, we have to options: This folder will contain the CMake generated Visual Studio files. Now, in the location where the extracted files are, create new folder and call it build. When we have downloaded the source files, we can extract them. Then, go ahead and download Source code (zip).Īt the time, when this article was written, the newest version of Assimp was 4.1.0. Then just simply click the Download button, and you will be redirected to their download page. You can download Assimp’s source files from the original page. Therefore, we have to build it from given source files. Authors of this library don’t distribute binary files. To be able to load 3D models with the pre-made project we need Assimp library. It was left on purpose - we will learn how to use CMake by building Assimp ourselves. The one dependency that is missing is Assimp library (responsible for loading 3D models). What is more, this project contains the following dependencies: You can download this sample project here. For this purpose, I’ve prepared a small package with basic OpenGL project that opens a window and renders an object. Secondly, we need some project files that we can work with. Prerequisitesįirst of all, we have to have CMake installed and added to the system PATH variable. to this tutorial and the CMake code are greatly welcome. I would like to state I’m not a CMake expert, so any improvements/comments/etc. Therefore, I’ve dived into this topic and with some luck I was able to create working CMake script, that will build a project for IDE of my choice, which in my case is Visual Studio Community. That was not enough for me since setting up an OpenGL project is quite cumbersome and requires some additional libraries to configure. Most CMake tutorials focus on the very basic usage - one file main.cpp and then create project with one CMake function add_executable and that’s it. I decided to create this tutorial about CMake and OpenGL since I couldn’t find many articles about this specific topic on the Internet. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |