18 lines
474 B
CMake
18 lines
474 B
CMake
include(FindSimpleLibrary)
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_simple_library(libczlib.a zlib.h "ZLIB_VERSION"
|
|
PATH_VAR CZLIB_PATH
|
|
VERSION_VAR CZLIB_VERSION)
|
|
|
|
find_package_handle_standard_args(czlib
|
|
REQUIRED_VARS CZLIB_PATH CZLIB_VERSION
|
|
VERSION_VAR CZLIB_VERSION)
|
|
|
|
if(czlib_FOUND)
|
|
add_library(czlib::czlib UNKNOWN IMPORTED)
|
|
set_target_properties(czlib::czlib PROPERTIES
|
|
IMPORTED_LOCATION "${CZLIB_PATH}"
|
|
INTERFACE_LINK_OPTIONS -lczlib)
|
|
endif()
|