Unverified Commit 696308a7 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

set cmake policy to honor HDF5_ROOT and NETCDF_ROOT. search for parallel...

set cmake policy to honor HDF5_ROOT and NETCDF_ROOT. search for parallel NetCDF only with parallel builds
parent e97bf005
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
enable_language(C)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
  cmake_policy(SET CMP0074 NEW)
endif()
find_package(HDF5 REQUIRED)
target_link_libraries(h5md PRIVATE ${HDF5_LIBRARIES})
target_include_directories(h5md PUBLIC ${HDF5_INCLUDE_DIRS})
+13 −6
Original line number Diff line number Diff line
# USER-NETCDF can use NetCDF, Parallel NetCDF (PNetCDF), or both. At least one necessary.
# NetCDF library enables dump style "netcdf", while PNetCDF enables dump style "netcdf/mpiio"
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
  cmake_policy(SET CMP0074 NEW)
endif()
if(NOT BUILD_MPI)
  find_package(NetCDF REQUIRED)
else()
  find_package(NetCDF)
  if(NETCDF_FOUND)
    find_package(PNetCDF)
else(NETCDF_FOUND)
  else()
    find_package(PNetCDF REQUIRED)
endif(NETCDF_FOUND)
  endif()
endif()

if(NETCDF_FOUND)
  target_link_libraries(lammps PRIVATE NetCDF::NetCDF)