mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
cmake: Fix an error in the declaration of target include directories
Properly declare target include directories for generated includes. Previously the non targeted `include_directories()` was used, which had issue when using the `png_static` target in a submodule. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
parent
843dbb7579
commit
8cc22a8c15
@ -363,8 +363,6 @@ else()
|
|||||||
message(STATUS "Could not find an AWK-compatible program")
|
message(STATUS "Could not find an AWK-compatible program")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
|
|
||||||
if(NOT AWK OR ANDROID OR IOS)
|
if(NOT AWK OR ANDROID OR IOS)
|
||||||
# No awk available to generate sources; use pre-built pnglibconf.h
|
# No awk available to generate sources; use pre-built pnglibconf.h
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
||||||
@ -715,6 +713,8 @@ if(PNG_SHARED)
|
|||||||
endif()
|
endif()
|
||||||
target_include_directories(png_shared
|
target_include_directories(png_shared
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
|
target_include_directories(png_shared
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||||
target_include_directories(png_shared SYSTEM
|
target_include_directories(png_shared SYSTEM
|
||||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
@ -729,6 +729,8 @@ if(PNG_STATIC)
|
|||||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||||
target_include_directories(png_static
|
target_include_directories(png_static
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
|
target_include_directories(png_static
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||||
target_include_directories(png_static SYSTEM
|
target_include_directories(png_static SYSTEM
|
||||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
@ -758,6 +760,8 @@ if(PNG_FRAMEWORK)
|
|||||||
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
|
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
|
||||||
target_include_directories(png_framework
|
target_include_directories(png_framework
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
|
target_include_directories(png_framework
|
||||||
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||||
target_include_directories(png_framework SYSTEM
|
target_include_directories(png_framework SYSTEM
|
||||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
|
@ -21,6 +21,7 @@ Author List
|
|||||||
* Dan Rosser
|
* Dan Rosser
|
||||||
* David Callu
|
* David Callu
|
||||||
* Eric Riff
|
* Eric Riff
|
||||||
|
* Erik Scholz
|
||||||
* Gianfranco Costamagna
|
* Gianfranco Costamagna
|
||||||
* Gleb Mazovetskiy
|
* Gleb Mazovetskiy
|
||||||
* Glenn Randers-Pehrson
|
* Glenn Randers-Pehrson
|
||||||
|
Loading…
x
Reference in New Issue
Block a user