LIST(APPEND CMAKE_PREFIX_PATH "${GMSH_ROOT_DIR}")
ENDIF(GMSH_ROOT_DIR)
-FIND_PATH(GMSH_INCLUDE_DIRS Gmsh.h gmsh.h PATH_SUFFIXES gmsh)
+FIND_PATH(GMSH_INCLUDE_DIRS NAMES GmshVersion.h PATH_SUFFIXES gmsh)
+FIND_PATH(GMSH_INCLUDE_DIRS_EXTRA NAMES Gmsh.h gmsh.h PATH_SUFFIXES gmsh)
+IF(GMSH_INCLUDE_DIRS AND GMSH_INCLUDE_DIRS_EXTRA)
+ IF(NOT ${GMSH_INCLUDE_DIRS} STREQUAL ${GMSH_INCLUDE_DIRS_EXTRA})
+ # gmsh stupidity: gmsh.h/Gmsh.h and GmshVersion.h may be in the same folder or in different ones!
+ LIST(APPEND GMSH_INCLUDE_DIRS "${GMSH_INCLUDE_DIRS_EXTRA}")
+ ENDIF()
+ENDIF()
FIND_LIBRARY(GMSH_LIBRARIES NAMES Gmsh gmsh)
INCLUDE(FindPackageHandleStandardArgs)