blob: 7a225e907691aa627639c747fbf9c991489bd2f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
diff '--color=auto' -aru a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2024-03-03 01:47:51.488773684 +0100
+++ b/CMakeLists.txt 2024-03-03 01:49:14.398777099 +0100
@@ -37,10 +37,6 @@
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
-# needed packages
-find_package(ZLIB REQUIRED)
-include_directories(${ZLIB_INCLUDE_DIR})
-
if(NOT WIN32)
find_library(M_LIBRARY
NAMES m
@@ -182,7 +178,7 @@
endif()
# NOW BUILD OUR TARGET
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
if(PNG_SHARED)
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
@@ -191,7 +187,7 @@
set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
endif()
- target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
+ target_link_libraries(${PNG_LIB_NAME} Zlib::zlib ${M_LIBRARY})
endif()
if(PNG_STATIC)
@@ -202,7 +198,7 @@
# msvc does not append 'lib' - do it here to have consistent name
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
endif()
- target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY})
+ target_link_libraries(${PNG_LIB_NAME_STATIC} Zlib::zlibstatic ${M_LIBRARY})
endif()
|