Created
March 14, 2021 14:17
-
-
Save eXpl0it3r/a9c7c88aa59f995f72a5420f5d17ed55 to your computer and use it in GitHub Desktop.
Link zlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_package(zlib) | |
if (NOT zlib_FOUND) | |
message("Fetch zlib content instead...") | |
include(FetchContent) | |
FetchContent_Declare( | |
zlib | |
GIT_REPOSITORY "https://github.com/madler/zlib.git" | |
GIT_TAG "v1.2.11" | |
) | |
FetchContent_GetProperties(zlib) | |
if (NOT zlib_POPULATED) | |
FetchContent_Populate(zlib) | |
add_subdirectory(${zlib_SOURCE_DIR} ${zlib_BINARY_DIR}) | |
endif() | |
target_include_directories(mytarget PUBLIC ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR}) | |
endif() | |
target_link_libraries(mytarget zlibstatic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment