Fix CMake build system auto-disabling of GLEWBRL-CAD
Status: ClosedTime to complete: 48 hrs Mentors: SeanTags: cmake, build system

BRL-CAD uses the CMake build system which generates project files for a variety of environments like Makefiles for *nix and MSVC projects for Windows.  The build system is described with a simple CMake scripting/macro language where we tell it how to build all of BRL-CAD.  When we add an external dependency, like using X11 for windowing, we add checks in this CMake scripting language to detect if X11 is available, find where it's installed, figure out what compiler flags to use, etc.  When it doesn't find it (e.g., on Windows), we auto-disable that feature and tools that require that feature.

One of our optional external dependencies is the GLEW library.  It should not be attempting to build GLEW when X11 isn't available but currently does.

This task is to get GLEW compiling properly so that it properly disables when it cannot be compiled (e.g., when X11 isn't available).

Provide your work as a single patch file with all changes included.  See http://brlcad.org/wiki/Deuces for help getting started.  You may need to manually move one of your system gl/x11 headers in order to properly test this on your own system. 

Uploaded Work
File name/URLFile sizeDate submitted
x11_cmake.patch1.7 KBDecember 19 2012 23:38 UTC
glew_x11.patch912 bytesDecember 20 2012 02:46 UTC
glew_x11_dry.patch966 bytesDecember 20 2012 20:10 UTC
Comments
Cezaron December 19 2012 13:53 UTCTask Claimed

I would like to work on this task.

Harmanpreet Singh on December 19 2012 14:00 UTCTask Assigned

This task has been assigned to Cezar. You have 48 hours to complete this task, good luck!

Cezaron December 19 2012 23:38 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 20 2012 19:24 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 20 2012 19:29 UTCglew patch

So the glew patch identifies the problem as trying to compile glew.c when we don't need to, but the fix shouldn't replicate the entire list of source files.  Try to adhere to the "DRY" principle: http://en.wikipedia.org/wiki/Don't_repeat_yourself


We fail at it ourselves sometimes, but it's an important guideline to follow especially when adding new logic/code.


Also be careful of stray edits.  Your first patch included a seemingly unrelated change to src/libfb/tcl.c (review changes via "svn diff" before commit is a good habit).

Cezaron December 20 2012 20:10 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 21 2012 02:39 UTCTask Closed

Congratulations, this task has been completed successfully.