| 1 |
# ZLib is a very popular library to use. |
| 2 |
# Some of the dependencies do not check for the system libraries, |
| 3 |
# which can be problematic. |
| 4 |
# We need to call find_package once again. |
| 5 |
if (${_OPT}use_zlib STREQUAL "system") |
| 6 |
message(STATUS "Fixing up ZLib mess...") |
| 7 |
|
| 8 |
find_package(ZLIB REQUIRED) |
| 9 |
|
| 10 |
set_target_properties(ZLIB::ZLIB PROPERTIES |
| 11 |
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") |
| 12 |
|
| 13 |
if(ZLIB_LIBRARY_RELEASE) |
| 14 |
set_property(TARGET ZLIB::ZLIB APPEND PROPERTY |
| 15 |
IMPORTED_CONFIGURATIONS RELEASE) |
| 16 |
|
| 17 |
set_property(TARGET ZLIB::ZLIB |
| 18 |
PROPERTY INTERFACE_LINK_LIBRARIES |
| 19 |
"${ZLIB_LIBRARY_RELEASE}" |
| 20 |
) |
| 21 |
endif() |
| 22 |
|
| 23 |
if(ZLIB_LIBRARY_DEBUG) |
| 24 |
set_property(TARGET ZLIB::ZLIB APPEND PROPERTY |
| 25 |
IMPORTED_CONFIGURATIONS DEBUG) |
| 26 |
|
| 27 |
set_property(TARGET ZLIB::ZLIB |
| 28 |
PROPERTY INTERFACE_LINK_LIBRARIES |
| 29 |
"${ZLIB_LIBRARY_DEBUG}" |
| 30 |
) |
| 31 |
endif() |
| 32 |
|
| 33 |
if(NOT ZLIB_LIBRARY_RELEASE AND NOT ZLIB_LIBRARY_DEBUG) |
| 34 |
set_property(TARGET ZLIB::ZLIB |
| 35 |
PROPERTY INTERFACE_LINK_LIBRARIES |
| 36 |
"${ZLIB_LIBRARY}" |
| 37 |
) |
| 38 |
endif() |
| 39 |
endif() |