Skip to content

Commit

Permalink
try to use pkg-config to find libhdf5 and openmpi
Browse files Browse the repository at this point in the history
  • Loading branch information
Janus Troelsen authored and yorikvanhavre committed Jul 17, 2017
1 parent 77734de commit b765193
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion CMakeLists.txt
Expand Up @@ -661,7 +661,33 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (WIN32)
find_package(HDF5 COMPONENTS NO_MODULE REQUIRED static)
else()
find_package(HDF5 REQUIRED)
find_package(PkgConfig)
pkg_search_module(HDF5 REQUIRED hdf5-serial)
if(NOT HDF5_FOUND)
find_package(HDF5 REQUIRED)
else()
add_compile_options(${HDF5_CFLAGS})
link_directories(${HDF5_LIBRARY_DIRS})
link_libraries(${HDF5_LIBRARIES})
find_file(Hdf5dotH hdf5.h PATHS ${HDF5_INCLUDE_DIRS} NO_DEFAULT_PATH)
if(NOT Hdf5dotH)
message( FATAL_ERROR "hdf5-serial not found in an error message above.")
endif()
endif()
check_include_file_cxx(hdf5.h HDF5_FOUND)
if(NOT HDF5_FOUND)
message( FATAL_ERROR "hdf5.h was not found.")
endif()

# Med Fichier can require MPI
pkg_search_module(OPENMPI REQUIRED ompi-cxx)
add_compile_options(${OPENMPI_CFLAGS})
link_directories(${OPENMPI_LIBRARY_DIRS})
link_libraries(${OPENMPI_LIBRARIES})
find_file(MpidotH mpi.h PATHS ${OPENMPI_INCLUDE_DIRS} NO_DEFAULT_PATH)
if(NOT MpidotH)
message( FATAL_ERROR "mpi.h was not found. Check for error above.")
endif()
endif()
find_package(MEDFile REQUIRED)
set(SMESH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/3rdParty/salomesmesh/inc)
Expand Down

0 comments on commit b765193

Please sign in to comment.