cmake: fix MSVC build

This commit is contained in:
oltolm
2024-03-18 00:34:08 +01:00
committed by Megamouse
parent c40826c140
commit 75b2dfa66d
3 changed files with 9 additions and 2 deletions
+5
View File
@@ -4,6 +4,11 @@ if (NOT USE_SYSTEM_LIBPNG)
# We use libpng's static library and don't need to build the shared library and run the tests
set(PNG_SHARED OFF CACHE BOOL "Build shared lib")
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests")
if (NOT USE_SYSTEM_ZLIB)
set(PNG_BUILD_ZLIB ON CACHE BOOL "Custom zlib location, else find_package is used")
add_library(ZLIB::ZLIB INTERFACE IMPORTED)
target_link_libraries(ZLIB::ZLIB INTERFACE 3rdparty_zlib)
endif()
set(SKIP_INSTALL_ALL ON)
add_subdirectory(libpng EXCLUDE_FROM_ALL)
target_include_directories(png_static INTERFACE "${libpng_BINARY_DIR}" "${libpng_SOURCE_DIR}")