Polytonic / Glitter

Dead Simple OpenGL
http://polytonic.github.io/Glitter/
2.46k stars 416 forks source link

How to build as library? #64

Open Journeyman1337 opened 4 years ago

Journeyman1337 commented 4 years ago

I am currently learning more about CMake, and I am wondering how I would modify Glitter so it outputs all the included libraries as static and/or dynamic libraries to include in projects along side their h files, instead of me having to work within the Glitter project within the generated solution.

hgeist2 commented 4 years ago

Hi @Journeyman-dev, a total CMake noob myself, but I have been using Glitter in a small hobby project from time to time in the last years.

It seems to me you could just swap out _addexecutable() in the CMakeLists.txt with _addlibrary() using the desired options, like STATIC for example.

What happens if you try that?

Journeyman1337 commented 4 years ago

I tried something like that: https://gist.github.com/Journeyman-dev/dc303ebe151db6b902c9521042d0ec77

assimp keeps putting its own library files in a different place. Also, the header files are all over the place. Seems like this is not very convenient after all.

hgeist2 commented 4 years ago

Found this: https://stackoverflow.com/questions/27771347/assimp-with-cmake

Maybe it can help to include assimp in your lib?