Skip to content

Commit b13a89f

Browse files
authored
Merge pull request #2833 from mwestphal/fix_szip_linking
Fix szip linking
2 parents 5c15957 + de822f9 commit b13a89f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

cmake/modules/FindSzip.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
#
33
# Szip_FOUND Set to true to indicate the szip library was found
44
# Szip_INCLUDE_DIRS The directory containing the header file szip/szip.h
5-
# Szip_LIBRARIES The libraries needed to use the szip library
5+
# Szip_LIBRARIES The libraries needed to use the szip library with the word "debug" and "optimized" when both are found
6+
# Szip_RELEASE_LIBRARY The path to the Szip release library if available
7+
# Szip_DEBUG_LIBRARY The path to the Szip debug library if available
8+
# Szip_LIBRARY The path to a Szip library, preferentially release but fallback to debug
69
#
710
# To specify an additional directory to search, set Szip_ROOT.
811
#
@@ -38,13 +41,17 @@ IF(Szip_INCLUDE_DIRS)
3841
PATH_SUFFIXES Release ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Release
3942
PATHS ${Szip_LIBRARY_DIRS} NO_DEFAULT_PATH)
4043

41-
SET(Szip_LIBRARIES )
44+
SET(Szip_LIBRARIES)
45+
SET(Szip_LIBRARY)
4246
IF(Szip_DEBUG_LIBRARY AND Szip_RELEASE_LIBRARY)
4347
SET(Szip_LIBRARIES debug ${Szip_DEBUG_LIBRARY} optimized ${Szip_RELEASE_LIBRARY})
48+
SET(Szip_LIBRARY ${Szip_RELEASE_LIBRARY})
4449
ELSEIF(Szip_DEBUG_LIBRARY)
4550
SET(Szip_LIBRARIES ${Szip_DEBUG_LIBRARY})
51+
SET(Szip_LIBRARY ${Szip_DEBUG_LIBRARY})
4652
ELSEIF(Szip_RELEASE_LIBRARY)
4753
SET(Szip_LIBRARIES ${Szip_RELEASE_LIBRARY})
54+
SET(Szip_LIBRARY ${Szip_RELEASE_LIBRARY})
4855
ENDIF(Szip_DEBUG_LIBRARY AND Szip_RELEASE_LIBRARY)
4956

5057
IF(Szip_LIBRARIES)

liblib/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ IF(Bz2_FOUND)
100100
SET(TLL_LIBS ${TLL_LIBS} ${Bz2_LIBRARIES})
101101
ENDIF()
102102
IF(SZIP_FOUND)
103-
SET(TLL_LIBS ${TLL_LIBS} ${SZIP_LIBRARIES})
103+
SET(TLL_LIBS ${TLL_LIBS} ${Szip_LIBRARY})
104104
ENDIF()
105105

106106
IF(HAVE_LIBDL)
@@ -125,9 +125,9 @@ IF(USE_HDF5)
125125
# builds:
126126
# Make sure that HDF5_C_LIBRARY appears *after*
127127
# HDF5_HL_LIBRARY.
128-
SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY})
128+
SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${HDF5_LIBRARIES} ${TLL_LIBS} ${Szip_LIBRARY})
129129
ELSE() # Windows CMake defines HDF5_LIBRARIES.
130-
SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY})
130+
SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${Szip_LIBRARY})
131131
ENDIF()
132132
ENDIF()
133133

0 commit comments

Comments
 (0)