CMake won't find custom MED include folder
I'm compiling gmsh
from source on a Ubuntu 20.04 [it's actually Neon, but it shouldn't matter] and its repositories ship libmed-dev
at version 4.0.0 which is too old to work with the current gmsh
.
I thus installed libmed
from source in a custom directory.
When configuring gmsh
with cmake
I can set the variable MED_LIB
to point to my custom libmed.so
but I cannot specify the custom include folder.
I was able to workaround it by editing the main CMakeLists.txt
file and adding, after line 962, which reads
list(APPEND EXTERNAL_LIBRARIES ${MED_LIB})
the lines
get_filename_component(MED_LIB_DIR ${MED_LIB} DIRECTORY)
list(APPEND EXTERNAL_INCLUDES ${MED_LIB_DIR}/../include)
but admittedly there should be a better way.