Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions ports/cgns/CONTROL

This file was deleted.

16 changes: 0 additions & 16 deletions ports/cgns/defines.patch

This file was deleted.

124 changes: 52 additions & 72 deletions ports/cgns/hdf5.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58f078fe7..46446da8a 100644
index d871a9dc8..d2c631023 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,71 +194,17 @@ endif (CGNS_ENABLE_FORTRAN AND HAS_FORTRAN)
option(CGNS_ENABLE_HDF5 "Enable or disable HDF5 interface" "OFF")
if (CGNS_ENABLE_HDF5)
@@ -232,46 +232,12 @@ if (CGNS_ENABLE_HDF5)
cmake_policy(SET CMP0074 NEW)
endif()

- if (CGNS_BUILD_SHARED)
- set (FIND_HDF_COMPONENTS C shared)
- else (CGNS_BUILD_SHARED)
- set (FIND_HDF_COMPONENTS C static)
- endif (CGNS_BUILD_SHARED)
- message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}")
-
- #set (SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME})
- set (SEARCH_PACKAGE_NAME "hdf5")
-
- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS})
- message (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}")
- if (HDF5_FOUND)
- add_executable (h5dump IMPORTED)
- if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
- set (FIND_HDF_COMPONENTS C)
-
Expand All @@ -31,40 +20,22 @@ index 58f078fe7..46446da8a 100644
- else (HDF5_BUILD_SHARED_LIBS)
- add_definitions (-DH5_BUILT_AS_STATIC_LIB)
- endif (HDF5_BUILD_SHARED_LIBS)
- if (BUILD_SHARED_LIBS AND WIN32)
- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dumpdll")
- else (BUILD_SHARED_LIBS AND WIN32)
- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
- endif (BUILD_SHARED_LIBS AND WIN32)
- else (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
- if (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND)
- if (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND)
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_SHARED_LIBRARY})
- else (HDF5_static_C_FOUND)
- else (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND)
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY})
- endif (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND)
- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
- endif (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND)
- endif (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
+ find_package(HDF5 CONFIG REQUIRED)
+ if(TARGET hdf5::hdf5-shared)
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared)
+ #add_executable(h5dump ALIAS hdf5::h5dump-shared)
+ set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared>)
+ else()
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static)
+ #add_executable(h5dump ALIAS hdf5::h5dump)
set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump>)
-
- set (HDF5_HAVE_H5PUBCONF_H 1)
- set (HDF5_HAVE_HDF5 1)
- set (HDF5_HDF5_HEADER "h5pubconf.h")
- set (HDF5_INCLUDE_DIR_GEN ${HDF5_INCLUDE_DIR})
- message (STATUS "HDF5-${HDF5_VERSION_STRING} found: INC=${HDF5_INCLUDE_DIR} TOOLS=${HDF5_TOOLS_DIR}")
- else (HDF5_FOUND)
- find_package (HDF5) # Legacy find
-#Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here
- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY_DIRS}/../bin)
-#Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here
- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY_DIRS}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}")
-
- #Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here
- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY}/../bin)
-
- #Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here
- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}")
- set (HDF5_BUILD_SHARED_LIBS 1)
- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
- else ()
Expand All @@ -73,36 +44,45 @@ index 58f078fe7..46446da8a 100644
- endif ()
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
-
- add_executable (h5dump IMPORTED)
- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
- set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump>)
- endif (HDF5_FOUND)
- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME})
-
+ endif()
+
+ find_package (HDF5 CONFIG REQUIRED)
+ if (TARGET hdf5::hdf5-shared)
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared)
+ else ()
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static)
+ endif ()

if (HDF5_FOUND)
set (HDF5_HAVE_H5PUBCONF_H 1)
set (HDF5_HAVE_HDF5 1)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 66b547ed1..4051f07d4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,13 +12,14 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
if (CGNS_ENABLE_HDF5)
add_definitions(-DBUILD_HDF5)
if (WIN32)
- if (HDF5_LIBRARY)
+ add_definitions(-DWIN32)
+ if (HDF5_BUILD_SHARED_LIBS)
# file(STRINGS ${HDF5_LIBRARY} HDF5isDLL REGEX "__imp__H5close")
# if (HDF5isDLL)
# this is only needed when using hdf5 dll libs
- add_definitions(-DWIN32 -D_HDF5USEDLL_)
+ add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB)
# endif (HDF5isDLL)
- endif (HDF5_LIBRARY)
+ endif (HDF5_BUILD_SHARED_LIBS)
endif (WIN32)
if(HDF5_NEED_MPI AND MPI_INC)
include_directories(${MPI_INC})
if (NOT DEFINED HDF5_INCLUDE_DIRS)
@@ -289,20 +255,10 @@ if (CGNS_ENABLE_HDF5)
endif (HDF5_FOUND)

set(HDF5_NEED_ZLIB "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?")
- if(HDF5_NEED_ZLIB)
- find_library(ZLIB_LIBRARY z)
- mark_as_advanced(CLEAR ZLIB_LIBRARY)
- else (HDF5_NEED_ZLIB)
- mark_as_advanced(FORCE ZLIB_LIBRARY)
- endif(HDF5_NEED_ZLIB)
+ set(HDF5_NEED_ZLIB ${HDF5_ENABLE_Z_LIB_SUPPORT} CACHE INTERNAL "" FORCE)

set(HDF5_NEED_SZIP "OFF" CACHE BOOL "Does the HDF5 library require linking to szip?")
- if (HDF5_NEED_SZIP)
- find_library(SZIP_LIBRARY szip)
- mark_as_advanced(CLEAR SZIP_LIBRARY)
- else (HDF5_NEED_SZIP)
- mark_as_advanced(FORCE SZIP_LIBRARY)
- endif (HDF5_NEED_SZIP)
+ set(HDF5_NEED_SZIP ${HDF5_ENABLE_SZIP_SUPPORT} CACHE INTERNAL "" FORCE)

# Check if HDF5 version is 1.8 or greater
if (HDF5_VERSION VERSION_LESS "1.8.0")
@@ -310,6 +266,7 @@ if (CGNS_ENABLE_HDF5)
endif (HDF5_VERSION VERSION_LESS "1.8.0")

set(HDF5_NEED_MPI "OFF" CACHE BOOL "Does the HDF5 library require linking to mpi? (Only true if using parallel HDF5)")
+ set(HDF5_NEED_MPI ${HDF5_ENABLE_PARALLEL} CACHE INTERNAL "" FORCE)
set(MPI_INC)
set(MPI_LIBS)
if (HDF5_NEED_MPI)
9 changes: 3 additions & 6 deletions ports/cgns/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CGNS/CGNS
REF 3420e23febf0eb38c1b05af3c157d614d8476557 # v3.4.0
SHA512 3fec1c32f1514cd9bc327f12f3f9db6a229df05f514193bd9e913d06b8ae6465664410a3c77a30b0c29f3e999e5efcb1ebed3a8b80e14be92035940c10b1d6d7
REF 86b686bce292eef7782cfb56b6acdb5123c96f49 # v4.2.0
SHA512 88df741acc1b650724bcbeb82ab0f7e593bf01e0a30c04b14b9915f4ea4331725cc24b87715dd08d93d5a3708660ca7f7874bc0a9c5505b76471802cf033e35d
HEAD_REF develop
PATCHES
hdf5.patch
linux_lfs.patch
zlib_szip_mpi.patch
defines.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
mpi HDF5_NEEDS_MPI
fortran CGNS_ENABLE_FORTRAN
tests CGNS_ENABLE_TESTS
hdf5 CGNS_ENABLE_HDF5
Expand Down Expand Up @@ -45,7 +42,7 @@ vcpkg_install_cmake()
file(INSTALL ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h)

file(INSTALL ${CURRENT_PORT_DIR}/cgnsconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) # we patched the config and the include is all that is needed
file(INSTALL ${CURRENT_PORT_DIR}/cgnsconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) # the include is all that is needed

set(TOOLS cgnscheck cgnscompress cgnsconvert cgnsdiff cgnslist cgnsnames)

Expand Down
64 changes: 64 additions & 0 deletions ports/cgns/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "cgns",
"version-semver": "4.2.0",
"description": "The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations.",
"homepage": "http://cgns.org/",
"default-features": [
"hdf5",
"lfsselector"
],
"features": {
"fortran": {
"description": "Enable fortran support (not yet implemented)"
},
"hdf5": {
"description": "Enable hdf5 support",
"dependencies": [
{
"name": "hdf5",
"default-features": false,
"features": [
"tools"
]
}
]
},
"legacy": {
"description": "Enable legacy support"
},
"lfs": {
"description": "Enable LFS support"
},
"lfsselector": {
"description": "Selector for LFS",
"dependencies": [
{
"name": "cgns",
"default-features": false,
"features": [
"lfs"
],
"platform": "!osx"
}
]
},
"mpi": {
"description": "Enable MPI support",
"dependencies": [
{
"name": "hdf5",
"default-features": false,
"features": [
"parallel"
]
}
]
},
"tests": {
"description": "Build tests"
},
"tools": {
"description": "Build tools"
}
}
}
35 changes: 0 additions & 35 deletions ports/cgns/zlib_szip_mpi.patch

This file was deleted.

29 changes: 0 additions & 29 deletions ports/paraview/CONTROL

This file was deleted.

Loading