-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[netcdf-c] Fix pc files; use features (#18120)
* Format manifest * New port-version * Quote filepath expressions * Port to vcpkg-cmake ports * Remove invalid nc-config file * Fix pc files * Use features * Add feature 'tools' * x-add-version * Fix build with msys2 mingw * Update git-tree
- Loading branch information
Showing
9 changed files
with
143 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt | ||
index 5b578f7..0731460 100644 | ||
--- a/liblib/CMakeLists.txt | ||
+++ b/liblib/CMakeLists.txt | ||
@@ -58,7 +58,7 @@ ENDIF() | ||
|
||
SET(TLL_LIBS "") | ||
|
||
-SET(TLL_LIBS ${TLL_LIBS} ${HAVE_LIBM} ZLIB::ZLIB) | ||
+SET(TLL_LIBS ${TLL_LIBS} ${HAVE_LIBM}) | ||
|
||
# Add extra dependencies specified via NC_EXTRA_DEPS | ||
SET(TLL_LIBS ${TLL_LIBS} ${EXTRA_DEPS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt | ||
index 65a3f87..30a008d 100644 | ||
--- a/libsrc/CMakeLists.txt | ||
+++ b/libsrc/CMakeLists.txt | ||
@@ -61,7 +61,7 @@ IF(HAVE_M4) | ||
IF(NOT MSVC) | ||
ADD_CUSTOM_TARGET(manpage ALL | ||
|
||
- COMMAND ${NC_M4} ${ARGS_MANPAGE} '${CMAKE_CURRENT_BINARY_DIR}/netcdf.m4' > '${CMAKE_CURRENT_BINARY_DIR}/netcdf.3' | ||
+ COMMAND ${NC_M4} ${ARGS_MANPAGE} "${CMAKE_CURRENT_BINARY_DIR}/netcdf.m4" > "${CMAKE_CURRENT_BINARY_DIR}/netcdf.3" VERBATIM | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 57d2d4b..3de6f8c 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1892,6 +1892,20 @@ LIST(REMOVE_DUPLICATES LINKFLAGS) | ||
SET(LIBS ${NC_LIBS}) | ||
SET(NC_LIBS "-lnetcdf") | ||
|
||
+set(NC_LIBS_PRIVATE " ${LIBS} ") | ||
+set(NC_REQUIRES_PRIVATE "") | ||
+macro(replace_pkgconfig_module PATTERN MODULE) | ||
+ if(NC_LIBS_PRIVATE MATCHES " ${PATTERN} ") | ||
+ string(REPLACE "${CMAKE_MATCH_0}" " " NC_LIBS_PRIVATE "${NC_LIBS_PRIVATE}") | ||
+ string(APPEND NC_REQUIRES_PRIVATE " ${MODULE}") | ||
+ endif() | ||
+endmacro() | ||
+replace_pkgconfig_module("-lhdf5_hl" "hdf5_hl") | ||
+replace_pkgconfig_module("-lhdf5" "hdf5") | ||
+replace_pkgconfig_module("-lmpi" "ompi-c") | ||
+replace_pkgconfig_module("-lCURL[^ ]*" "libcurl") | ||
+replace_pkgconfig_module("-lZLIB[^ ]*" "zlib") | ||
+ | ||
configure_file( | ||
${netCDF_SOURCE_DIR}/netcdf.pc.in | ||
${netCDF_BINARY_DIR}/netcdf.pc @ONLY) | ||
diff --git a/netcdf.pc.in b/netcdf.pc.in | ||
index 22b5594..a48b7c2 100644 | ||
--- a/netcdf.pc.in | ||
+++ b/netcdf.pc.in | ||
@@ -9,5 +9,6 @@ Description: NetCDF Client Library for C | ||
URL: http://www.unidata.ucar.edu/netcdf | ||
Version: @PACKAGE_VERSION@ | ||
Libs: -L${libdir} @NC_LIBS@ | ||
-Libs.private: @LIBS@ | ||
+Libs.private: @NC_LIBS_PRIVATE@ | ||
Cflags: -I${includedir} | ||
+Requires.private: @NC_REQUIRES_PRIVATE@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "netcdf-c", | ||
"version-string": "4.7.4", | ||
"port-version": 3, | ||
"description": "A set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.", | ||
"homepage": "https://github.com/Unidata/netcdf-c", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"default-features": [ | ||
"dap", | ||
"netcdf-4" | ||
], | ||
"features": { | ||
"dap": { | ||
"description": "Build with DAP remote access client support", | ||
"dependencies": [ | ||
"curl" | ||
] | ||
}, | ||
"netcdf-4": { | ||
"description": "Build with netCDF-4/HDF5 support", | ||
"dependencies": [ | ||
{ | ||
"name": "hdf5", | ||
"features": [ | ||
"zlib" | ||
] | ||
} | ||
] | ||
}, | ||
"tools": { | ||
"description": "Build utilities" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters