C-Chads / tinygl

The penultimate portable graphics library
Other
453 stars 53 forks source link

Add CMake support #2

Closed RobLoach closed 3 years ago

RobLoach commented 3 years ago

This introduces a CMake file which allows compilation of TinyGL as either a static or shared library, along with all the examples. This makes it really easy to link to TinyGL from another project that uses CMake...

add_subdirectory(path/to/tinygl)
target_link_libraries(myproject tinygl-static)
RobLoach commented 3 years ago

It seems I can't test it with my system's old Cmake.

Yeah, it's currently using NAME_WE, which was introduced in CMake 3.14. We could switch it to not require that, but :shrug:

It looks like gek169 automatically removed it? https://github.com/C-Chads/tinygl/commit/a994eee8ecfcdf06a7b70a704074ad6c193f7415