mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 03:29:47 +00:00
FindPNG: add 'm' dependencies to static lib on Linux
This commit is contained in:
parent
7fe99b813c
commit
ad41c98cbb
@ -94,6 +94,10 @@ if(ZLIB_FOUND)
|
||||
set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
|
||||
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatibility
|
||||
set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND
|
||||
("${PNG_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))
|
||||
list(APPEND PNG_LIBRARIES m)
|
||||
endif()
|
||||
|
||||
if (CYGWIN)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
@ -110,6 +114,12 @@ if(ZLIB_FOUND)
|
||||
INTERFACE_COMPILE_DEFINITIONS "${_PNG_COMPILE_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND
|
||||
("${PNG_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))
|
||||
set_property(TARGET PNG::PNG APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES m)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${PNG_LIBRARY}")
|
||||
set_target_properties(PNG::PNG PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
|
Loading…
Reference in New Issue
Block a user