Skip to content

Commit f7c053e

Browse files
authored
Merge pull request #942 from sant0s12/master
Add ZLIB::ZLIB alias and conditional renaming
2 parents e7618a6 + 509598d commit f7c053e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/zlib_external.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ FetchContent_Declare(zlib
1414
USES_TERMINAL_DOWNLOAD TRUE)
1515
FetchContent_MakeAvailable(zlib)
1616

17+
add_library(ZLIB::ZLIB ALIAS zlib)
18+
1719
# Fix Windows zlib dll names from "zlibd1.dll" to "zlib.dll":
18-
if(WIN32)
20+
if(WIN32 AND BUILD_SHARED_LIBS)
1921
set_target_properties(zlib PROPERTIES OUTPUT_NAME "zlib")
2022
set_target_properties(zlib PROPERTIES DEBUG_POSTFIX "")
2123
set_target_properties(zlib PROPERTIES SUFFIX ".dll")

0 commit comments

Comments
 (0)