brainvisa / aims-free

Analysis of Images and Signal for neuroimaging
Other
6 stars 3 forks source link

Added CMake variables to allow OpenGL linking customization #100

Closed sapetnioc closed 1 year ago

sapetnioc commented 1 year ago

To allow compilation in a build environment set up using Conda, I added two optional CMake variables that must be used when compiling OpenGL code:

The content of these variables will be set only when necessary. For the moment they are defined in bv_maker.cfg.

sapetnioc commented 1 year ago

To date the corresponding bv_maker.cfg line for Conda compilation is the following:

cmake_options += '-DOPENGL_LIBRARY_DIRECTORIES=$CASA/conda/lib;/lib/x86_64-linux-gnu' '-DOPENGL_LIBRARIES=X11;GL;GLdispatch;GLX;/lib/x86_64-linux-gnu/librt.so.1'

For Conda compilation, bv_maker.cfg is specific to that environment (and would be provided through GitHub). Therefore it is acceptable to me to keep this solution. Another option would be to reject this PR and deal with OpenGL entirerly when building Conda environment by compiling a Mesa used only for compilation.

denisri commented 1 year ago

Probably not the cleanest of every possible solution, but we can do that also. OK for me.

sapetnioc commented 1 year ago

I changed variable names to OPENGL_FIX_LIBRARY_DIRECTORIES and OPENGL_FIX_LIBRARIES. Not a big deal.

But I also had to replace Py_hash_t by long in sip files to make it work with sip version provided by Conda. It does not seems very clean to me if the expected type is a hash. But I do not really know sip and these __hash__ methods.