wjakob / nanogui

Minimalistic GUI library for OpenGL
Other
4.66k stars 608 forks source link

Create occasional releases (with tags) of nanogui on github. #73

Closed r-chris closed 8 years ago

r-chris commented 8 years ago

As mentioned in #1 nanogui is designed to be used as a CMake subproject, which I am keen to do as well for another OpenSource project (http://c42f.github.io/displaz). Right now it appears you manually reference a local subfolder as the URL in CMake:

ExternalProject_Add(nanogui_p
  URL             "${CMAKE_SOURCE_DIR}/ext/nanogui"
  PREFIX          "ext_build"
  CMAKE_ARGS      ${CMAKE_EXTERNAL_ARGUMENTS}
)

This, of course, is a working solution, but it might be useful to also have releases on github that could be included as weburls with a specific MD5 hash and allow us to easily get the same version in the future instead of always using the latest master:

ExternalProject_Add(
    nanogui
    URL https://github.com/wjakob/nanogui/archive/master.zip
    URL_MD5 0123456789
    [...]

I know this is additional work and I can technically do this by referencing my own fork, but maybe you could consider it useful.

r-chris commented 8 years ago

PS: for now I created an example release on my fork: https://github.com/r-chris/nanogui/releases

r-chris commented 8 years ago

Turns out that you can actually use a git commit id as part of the ExternalProject_Add cmake command, so technically there is no need for tags and I can just use a specific git hash instead of some random tag.

https://cmake.org/cmake/help/v3.0/module/ExternalProject.html

ExternalProject_Add(
    nanogui
    #URL https://github.com/r-chris/nanogui/archive/v2016.06.15.zip
    #URL_MD5 8e2ba7954ac401dd589d57213b34db00
    GIT_REPOSITORY https://github.com/r-chris/nanogui.git
    GIT_TAG v2016.06.15
    GIT_SUBMODULES
wjakob commented 8 years ago

Actually the ExternalProject_Add way of building nanogui is quite inferior to a simple add_subdirectory. I've run into numerous concurrency issues with ExternalProject_Add, and the handling of debug/release builds on Windows is tricky. See here for a project that builds with nanogui using add_subdirectory: https://github.com/wjakob/instant-meshes/

wjakob commented 8 years ago

This works hand in hand with git submodules, which I found to be a really nice fit.

r-chris commented 8 years ago

Thanks for the info - I am indeed struggling a bit with ExternalProject_Add and will try add_subdirectory way instead.