-
-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use only one find_package call for zlib. #5280
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fc03971
Use only one find_package call for zlib.
byrnHDF f54d538
Default built zlib system libs is expected to be shared.
byrnHDF ff1897c
Merge branch 'HDFGroup:develop' into develop-zlib
byrnHDF b6af944
Remove debug code and exclude windows
byrnHDF 7200ff1
Fix typos
byrnHDF 17690f6
Change option to mean what it does
byrnHDF 0c01767
Native zlib-ng is not found by the CMake module, use config
byrnHDF 783ca6c
Add zlib system test job
byrnHDF d11ec20
Add verbose logging
byrnHDF 7cccc2d
HDF5_ALLOW_EXTERNAL_SUPPORT forces builds
byrnHDF 75ba3fb
Correct option setting
byrnHDF 8cf4575
Merge branch 'HDFGroup:develop' into develop-zlib
byrnHDF e72e2a8
Correct description and release note
byrnHDF 6b29279
Merge branch 'HDFGroup:develop' into develop-zlib
byrnHDF 910ca72
Merge branch 'HDFGroup:develop' into develop-zlib
byrnHDF 951df41
Address typo and grammer.
byrnHDF File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 | ||||
---|---|---|---|---|---|---|
|
@@ -13,9 +13,13 @@ option (HDF5_USE_ZLIB_NG "Use zlib-ng library as zlib library" OFF) | |||||
option (HDF5_USE_ZLIB_STATIC "Find static zlib library" OFF) | ||||||
option (HDF5_USE_LIBAEC_STATIC "Find static AEC library" OFF) | ||||||
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" OFF) | ||||||
mark_as_advanced (ZLIB_USE_EXTERNAL) | ||||||
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" OFF) | ||||||
mark_as_advanced (SZIP_USE_EXTERNAL) | ||||||
option (ZLIB_USE_LOCALCONTENT "Use local file for ZLIB FetchContent" OFF) | ||||||
mark_as_advanced (ZLIB_USE_LOCALCONTENT) | ||||||
option (LIBAEC_USE_LOCALCONTENT "Use local file for LIBAEC FetchContent" OFF) | ||||||
mark_as_advanced (LIBAEC_USE_LOCALCONTENT) | ||||||
|
||||||
if (NOT ZLIB_USE_LOCALCONTENT) | ||||||
if (HDF5_USE_ZLIB_NG) | ||||||
|
@@ -85,30 +89,35 @@ endif () | |||||
if(NOT DEFINED ZLIBNG_PACKAGE_NAME) | ||||||
set(ZLIBNG_PACKAGE_NAME "zlib-ng") | ||||||
endif () | ||||||
option (HDF5_ENABLE_ZLIB_SUPPORT "Enable Zlib Filters" OFF) | ||||||
if (HDF5_ENABLE_ZLIB_SUPPORT) | ||||||
if (NOT H5_ZLIB_HEADER) | ||||||
if (NOT ZLIB_USE_EXTERNAL) | ||||||
option (HDF5_MODULE_MODE_ZLIB "Prefer module mode to find ZLIB" ON) | ||||||
mark_as_advanced (HDF5_MODULE_MODE_ZLIB) | ||||||
if (HDF5_USE_ZLIB_NG) | ||||||
set (HDF5_MODULE_MODE_ZLIB OFF CACHE BOOL "" FORCE) | ||||||
set (PACKAGE_NAME ${ZLIBNG_PACKAGE_NAME}${HDF_PACKAGE_EXT}) | ||||||
else () | ||||||
set (PACKAGE_NAME ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}) | ||||||
endif () | ||||||
set(ZLIB_FOUND FALSE) | ||||||
if (HDF5_USE_ZLIB_STATIC) | ||||||
set(ZLIB_SEARCH_TYPE static) | ||||||
message (VERBOSE "Filter HDF5_ZLIB package name:${PACKAGE_NAME}") | ||||||
if (HDF5_MODULE_MODE_ZLIB) | ||||||
# Expect that the default shared library is expected with FindZLIB.cmake | ||||||
find_package (ZLIB MODULE) | ||||||
else () | ||||||
set(ZLIB_SEARCH_TYPE shared) | ||||||
endif () | ||||||
# Search pure Config mode first | ||||||
find_package (ZLIB NAMES ${PACKAGE_NAME} OPTIONAL_COMPONENTS ${ZLIB_SEARCH_TYPE}) | ||||||
if (NOT ZLIB_FOUND) | ||||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") | ||||||
set(ZLIB_USE_STATIC_LIBS ${HDF5_USE_ZLIB_STATIC}) | ||||||
endif() | ||||||
find_package (ZLIB) # Legacy find | ||||||
# Expect that a correctly built library with CMake config files is available | ||||||
if (HDF5_USE_ZLIB_STATIC) | ||||||
set(ZLIB_SEARCH_TYPE static) | ||||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") | ||||||
set(ZLIB_USE_STATIC_LIBS ${HDF5_USE_ZLIB_STATIC}) | ||||||
endif() | ||||||
else () | ||||||
set(ZLIB_SEARCH_TYPE shared) | ||||||
endif () | ||||||
find_package (ZLIB NAMES ${PACKAGE_NAME} CONFIG OPTIONAL_COMPONENTS ${ZLIB_SEARCH_TYPE}) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue #5306 created |
||||||
endif () | ||||||
set(H5_ZLIB_FOUND ${ZLIB_FOUND}) | ||||||
set(H5_ZLIB_FOUND ZLIB_FOUND}) | ||||||
if (H5_ZLIB_FOUND) | ||||||
if (HDF5_USE_ZLIB_NG) | ||||||
set (H5_ZLIB_HEADER "zlib-ng.h") | ||||||
|
@@ -117,11 +126,13 @@ if (HDF5_ENABLE_ZLIB_SUPPORT) | |||||
endif () | ||||||
set (H5_ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) | ||||||
set (H5_ZLIB_INCLUDE_DIRS ${H5_ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) | ||||||
# The FindZLIB.cmake module does not set an OUTPUT_NAME | ||||||
# on the target. The target returned is: ZLIB::ZLIB | ||||||
get_filename_component (libname ${ZLIB_LIBRARIES} NAME_WLE) | ||||||
string (REGEX REPLACE "^lib" "" libname ${libname}) | ||||||
set_target_properties (ZLIB::ZLIB PROPERTIES OUTPUT_NAME ${libname}) | ||||||
if (NOT WIN32) #windows has a list of names | ||||||
# The FindZLIB.cmake module does not set an OUTPUT_NAME | ||||||
# on the target. The target returned is: ZLIB::ZLIB | ||||||
get_filename_component (libname ${ZLIB_LIBRARIES} NAME_WLE) | ||||||
string (REGEX REPLACE "^lib" "" libname ${libname}) | ||||||
set_target_properties (ZLIB::ZLIB PROPERTIES OUTPUT_NAME ${libname}) | ||||||
endif () | ||||||
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ZLIB::ZLIB) | ||||||
endif () | ||||||
else () | ||||||
|
@@ -161,7 +172,6 @@ set(H5_SZIP_FOUND FALSE) | |||||
if(NOT DEFINED LIBAEC_PACKAGE_NAME) | ||||||
set(LIBAEC_PACKAGE_NAME "libaec") | ||||||
endif () | ||||||
option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) | ||||||
if (HDF5_ENABLE_SZIP_SUPPORT) | ||||||
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" ON) | ||||||
if (NOT SZIP_USE_EXTERNAL) | ||||||
|
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue #5306 created