summaryrefslogtreecommitdiffhomepage
path: root/third-party/libpng/3.includes.patch
blob: c48e163e68ff07c9a362268290e7312f8ede4443 (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
diff '--color=auto' -arNu a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2024-03-03 02:11:16.832164723 +0100
+++ b/CMakeLists.txt	2024-03-03 02:19:25.775518136 +0100
@@ -106,7 +106,6 @@
 # Use the prebuilt pnglibconf.h file from the scripts folder
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
                ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 # OUR SOURCES
 set(libpng_public_hdrs
@@ -177,9 +176,6 @@
   add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED)
 endif()
 
-# NOW BUILD OUR TARGET
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
 if(PNG_SHARED)
   add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
   if(MSVC)
@@ -187,6 +183,7 @@
     set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
     set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
   endif()
+  target_include_directories(${PNG_LIB_NAME} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
   target_link_libraries(${PNG_LIB_NAME} Zlib::zlib ${M_LIBRARY})
 endif()
 
@@ -198,6 +195,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_include_directories(${PNG_LIB_NAME_STATIC} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
   target_link_libraries(${PNG_LIB_NAME_STATIC} Zlib::zlibstatic ${M_LIBRARY})
 endif()