On my Ubuntu setup, compilation failes when using med.h, since

libmedc is built with openMPI, while freeCAD selects hdf5-serial.

libmed declares functions prototypes which has MPI parameters if
built for openMPI, causing compilation errors. Doing some online
searches reveals that some users manually changes the include-paths
to hdf5-openmpi if this error happens.

This patch tries to autodetect this situation.
This commit is contained in:
Stian Skjelstad
2018-12-21 02:27:05 +01:00
committed by Yorik van Havre
parent 2226da3a20
commit dccf48d3f4
2 changed files with 14 additions and 2 deletions

View File

@@ -41,6 +41,10 @@ IF(MEDFILE_ROOT_DIR)
ENDIF(MEDFILE_ROOT_DIR)
FIND_PATH(MEDFILE_INCLUDE_DIRS med.h PATH_SUFFIXES med)
find_file(meddotH med.h PATHS ${MEDFILE_INCLUDE_DIRS} NO_DEFAULT_PATH)
if(NOT meddotH)
message( FATAL_ERROR "med.h not found in an error message above.")
endif()
#FIND_PROGRAM(MDUMP mdump)
FIND_LIBRARY(MEDFILE_C_LIBRARIES NAMES medC)
FIND_LIBRARY(MEDFILE_F_LIBRARIES NAMES med)