skaslev / gl3w

Simple OpenGL core profile loading
http://github.com/skaslev/gl3w
The Unlicense
705 stars 157 forks source link

Helper scripts for configuration-time package generation #61

Closed disco-fella closed 5 years ago

disco-fella commented 5 years ago

Despite the fact that user is supposed to manually run cmake . in the gl3w folder to generate gl3w files prior to build system generation in their project, the process still can be automated by the means of CMake using execute_process to run cmake in the gl3w folder during configuration stage. But since @skaslev asked here, I've added a few scripts to encapsulate these additional steps.

With this patch user can get gl3w files generated during configuration stage:

set(GL3W_SOURCE_DIR ThirdParty/gl3w) include(${GL3W_SOURCE_DIR}/generate-package.txt) find_package(gl3w REQUIRED) target_link_libraries(foo gl3w)

... or even:

set(GL3W_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/gl3w) include(${GL3W_SOURCE_DIR}/generate-and-find-package.txt) target_link_libraries(foo gl3w)