diff options
author | Brad King <brad.king@kitware.com> | 2019-05-20 14:03:48 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-20 14:04:00 (GMT) |
commit | 28ee31149030c75c32ebbf134502a9d020dbd54b (patch) | |
tree | 620fcf29ad95945841fb391d5e0abcb4fe8a4491 | |
parent | 9860b4c5e8756cb58c4cdfc27a14194f823aa0ab (diff) | |
parent | 21c74faa1ad75aa52d465467908edcb888cb53bf (diff) | |
download | CMake-28ee31149030c75c32ebbf134502a9d020dbd54b.zip CMake-28ee31149030c75c32ebbf134502a9d020dbd54b.tar.gz CMake-28ee31149030c75c32ebbf134502a9d020dbd54b.tar.bz2 |
Merge topic 'FindPNG-static-define'
21c74faa1a FindPNG: Fix definitions on imported target
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Paolo Lammens <lammenspaolo@gmail.com>
Merge-request: !3337
-rw-r--r-- | Modules/FindPNG.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake index 2208b48..a7908c5 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") |