Possible bug in cMake/FindMEDFile.cmake

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
francisco.colaco
Posts: 1
Joined: Tue Apr 24, 2018 7:07 pm

Possible bug in cMake/FindMEDFile.cmake

Postby francisco.colaco » Tue Apr 24, 2018 7:15 pm

cMake/FindMEDFile.cmake prevents FreeCAD to be built in Fedora. The problem arises because FIND_PATH has no default CMAKE_INCLUDE_DIRS or CMAKE_PREFIX_PATH with which to make.

I have modified the file and it seems to configure correctly. Please review the diff I enclose. I have no experience with cmake and used the CMake documentation and the other files to build what seems to be sensible defaults.


1 file changed, 9 insertions(+), 1 deletion(-)
cMake/FindMEDFile.cmake | 10 +++++++++-

modified cMake/FindMEDFile.cmake
@@ -40,7 +40,15 @@ IF(MEDFILE_ROOT_DIR)
LIST(APPEND CMAKE_PREFIX_PATH "${MEDFILE_ROOT_DIR}")
ENDIF(MEDFILE_ROOT_DIR)

-FIND_PATH(MEDFILE_INCLUDE_DIRS med.h)
+FIND_PATH(MEDFILE_INCLUDE_DIRS med.h
+ ${CMAKE_INCLUDE_PATH}
+ "[HKEY_CURRENT_USER\\software\\libmed\\src]"
+ "[HKEY_CURRENT_USER\\libmed\\src]"
+ $ENV{MEDFILE_ROOT_DIR}/src/
+ /usr/local/include/med
+ /usr/include/med
+ )
+
#FIND_PROGRAM(MDUMP mdump)
FIND_LIBRARY(MEDFILE_C_LIBRARIES NAMES medC)
FIND_LIBRARY(MEDFILE_F_LIBRARIES NAMES med)