summaryrefslogtreecommitdiff
path: root/Modules/FindPNG.cmake
diff options
context:
space:
mode:
authorAxel Huebl <axel.huebl@plasma.ninja>2019-05-17 17:08:37 +0200
committerBrad King <brad.king@kitware.com>2019-05-17 12:07:18 -0400
commit21c74faa1ad75aa52d465467908edcb888cb53bf (patch)
tree97b84e4dff2accc1b6ecb2038d6c26c1af2030f7 /Modules/FindPNG.cmake
parent94b2c757725b86a38b7934f9e1084debe6dbe2de (diff)
downloadcmake-21c74faa1ad75aa52d465467908edcb888cb53bf.tar.gz
FindPNG: Fix definitions on imported target
The `INTERFACE_COMPILE_DEFINITIONS` property should not have ``-D`` in its value.
Diffstat (limited to 'Modules/FindPNG.cmake')
-rw-r--r--Modules/FindPNG.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 2208b4847b..a7908c5c3c 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -100,13 +100,14 @@ if(ZLIB_FOUND)
# No need to define PNG_USE_DLL here, because it's default for Cygwin.
else()
set (PNG_DEFINITIONS -DPNG_STATIC)
+ set(_PNG_COMPILE_DEFINITIONS PNG_STATIC)
endif()
endif ()
if(NOT TARGET PNG::PNG)
add_library(PNG::PNG UNKNOWN IMPORTED)
set_target_properties(PNG::PNG PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}"
+ INTERFACE_COMPILE_DEFINITIONS "${_PNG_COMPILE_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
if(EXISTS "${PNG_LIBRARY}")
@@ -129,6 +130,8 @@ if(ZLIB_FOUND)
IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}")
endif()
endif()
+
+ unset(_PNG_COMPILE_DEFINITIONS)
endif ()
if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")