Skip to content

Commit

Permalink
Merge branch 'main' into gh2431.wif
Browse files Browse the repository at this point in the history
  • Loading branch information
WardF committed Dec 12, 2023
2 parents 4673c55 + 489d978 commit 907ab41
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ ENDIF()

# Enable Parallel IO with netCDF-4/HDF5 files using HDF5 parallel I/O.
SET(STATUS_PARALLEL "OFF")
set(IMPORT_MPI "")
OPTION(ENABLE_PARALLEL4 "Build netCDF-4 with parallel IO" "${HDF5_PARALLEL}")
IF(ENABLE_PARALLEL4 AND ENABLE_HDF5)
IF(NOT HDF5_PARALLEL)
Expand All @@ -1529,6 +1530,7 @@ IF(ENABLE_PARALLEL4 AND ENABLE_HDF5)
FILE(COPY "${netCDF_BINARY_DIR}/tmp/run_par_tests.sh"
DESTINATION ${netCDF_BINARY_DIR}/h5_test
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
set(IMPORT_MPI "include(CMakeFindDependencyMacro)\nfind_dependency(MPI COMPONENTS C)")
ENDIF()
ENDIF()

Expand Down
4 changes: 4 additions & 0 deletions liblib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ IF(STATUS_PARALLEL)
target_link_libraries(netcdf MPI::MPI_C)
ENDIF(STATUS_PARALLEL)

IF(TARGET MPI::MPI_C)
target_link_libraries(netcdf MPI::MPI_C)
ENDIF(TARGET MPI::MPI_C)

IF(MOD_NETCDF_NAME)
SET_TARGET_PROPERTIES(netcdf PROPERTIES LIBRARY_OUTPUT_NAME ${NETCDF_LIB_NAME})
SET_TARGET_PROPERTIES(netcdf PROPERTIES ARCHIVE_OUTPUT_NAME ${NETCDF_LIB_NAME})
Expand Down
2 changes: 2 additions & 0 deletions netCDFConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ set(netCDF_LIBRARIES netCDF::netcdf)
# include target information
include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake")

@IMPORT_MPI@

# Compiling Options
#
set(netCDF_C_COMPILER "@CC_VERSION@")
Expand Down
3 changes: 3 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ MACRO(buildplugin TARGET TARGETLIB)
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF")
# Set file name & location
set_target_properties(${TARGET} PROPERTIES COMPILE_PDB_NAME ${TARGET} COMPILE_PDB_OUTPUT_DIR ${CMAKE_BINARY_DIR})
IF(MPI_C_INCLUDE_PATH)
target_include_directories(${TARGET} PRIVATE ${MPI_C_INCLUDE_PATH})
ENDIF(MPI_C_INCLUDE_PATH)
ENDIF()

IF(STATUS_PARALLEL)
Expand Down

0 comments on commit 907ab41

Please sign in to comment.