Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FindGLM.cmake not in glm 0.9.7, is it a deprecated way to find libraries in CMAKE?

Tags:

cmake

glm-math

So looking through the newest release of GLM 0.9.7, I dont see a FindGLM.cmake file anywhere, used to easily include GLM in CMAKE. I could always use an old version of it found online but the following commit had me stumped:

https://github.com/g-truc/glm/commit/62a7daddcf082f754000fc5e42d7bcdf93c895f7

Commit message is "Removed obsolete FindGLM". So, did the developer just dump it or are there in fact a new way to find libraries in CMAKE?

like image 461
Sheph Avatar asked Jan 06 '16 13:01

Sheph


1 Answers

Yes, CMake Find modules (FindXyz.cmake files) are deprecated in favour of Package Config files (usually named XyzConfig.cmake). The original philosophy is that Find modules are shipped and maintained by CMake, while Package Config files are shipped and maintained by the package they are intended to find.

CMake's find_package command actually has two modes: Module mode (legacy, using Find modules) and Config mode (preferred, using Package Config files).

For the client consuming the package, little should change (unless more customisation is desired, which is offered by the Config mode of find_package).

Notice that the very commit to which you linked not only drops FindGLM.cmake, but also adds a glmConfig.cmake file.

like image 168
Angew is no longer proud of SO Avatar answered Nov 08 '22 14:11

Angew is no longer proud of SO