summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-07 13:42:02 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-07 13:42:12 (GMT)
commit8fe6d06c2c3020d302a889158d08ef210e07a28f (patch)
tree25d164ffc2e9e437f9b18bc51aa67879c447f423 /Modules
parent64ac12ec8043cb827419032f3ac2d6e3d0e050bf (diff)
parent67b6f1a09b3e14373ba5683d11300a145c80877f (diff)
downloadCMake-8fe6d06c2c3020d302a889158d08ef210e07a28f.zip
CMake-8fe6d06c2c3020d302a889158d08ef210e07a28f.tar.gz
CMake-8fe6d06c2c3020d302a889158d08ef210e07a28f.tar.bz2
Merge topic 'zlib-windows-cross-compile-fix'
67b6f1a09b FindZLIB: fix CMAKE_FIND_LIBRARY_PREFIXES being unset when it was empty Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7647
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindZLIB.cmake24
1 files changed, 20 insertions, 4 deletions
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index f50116f..be5c775 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -92,8 +92,16 @@ endforeach()
# Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library
if(NOT ZLIB_LIBRARY)
- set(_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
- set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ if(DEFINED CMAKE_FIND_LIBRARY_PREFIXES)
+ set(_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+ else()
+ set(_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
+ endif()
+ if(DEFINED CMAKE_FIND_LIBRARY_SUFFIXES)
+ set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
+ else()
+ set(_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
+ endif()
# Prefix/suffix of the win32/Makefile.gcc build
if(WIN32)
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
@@ -114,8 +122,16 @@ if(NOT ZLIB_LIBRARY)
endforeach()
# Restore the original find library ordering
- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
- set(CMAKE_FIND_LIBRARY_PREFIXES ${_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES})
+ if(DEFINED _zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES "${_zlib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}")
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES)
+ endif()
+ if(DEFINED _zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
+ set(CMAKE_FIND_LIBRARY_PREFIXES "${_zlib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}")
+ else()
+ set(CMAKE_FIND_LIBRARY_PREFIXES)
+ endif()
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(ZLIB)