Still dealing with CMake issues…

So tonight I learnt a lesson about rushing things. Although CMake was set-up and working for the build, there were many situations (like trying to open the folder in Visual Studio) where CMake would just throw a tantrum.

I originally learnt how to get CMake working, by reading a blog post at the following URL:

https://shot511.github.io/2018-05-29-how-to-setup-opengl-project-with-cmake/

The author implemented his own scripts for finding Asimp and GLFW3, so I did a copy and paste job to get the ball rolling. It seems though I didn’t understand how it really worked.

Tonight after a lot of playing around, I realised that the Find***.cmake scripts are really much more useful than I originally gave them credit for. I originally just assumed they were there to resolve the directory only for specific dependencies. However when I looked closer tonight, I also found they are able to do a number of other things, with the most important one to me being the ability to figure out what fille to use (.lib .a .so etc…).

So after several attempts, I managed to remove hard coded links to the libraries, and instead setup a find script for Lua, GLEW, GLFW3 and GLM, and it all works properly!

Although I didn’t get the project to boot in Visual Studio today. I did learn the real reason why it wasn’t working, and what I’ll need to do to get CMake to work on other platforms like OSX and Linux too.