diff --git a/cmake/FindSkia.cmake b/cmake/FindSkia.cmake index 35312f92f..344de4d75 100644 --- a/cmake/FindSkia.cmake +++ b/cmake/FindSkia.cmake @@ -125,6 +125,16 @@ if(NOT ZLIB_LIBRARIES) set(ZLIB_LIB_FILE "${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib/lib/zlib${ZLIB_MSVC_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() + set(LAF_ARGS_FOR_EXTERNAL_PROJECT) + list(APPEND LAF_ARGS_FOR_EXTERNAL_PROJECT + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH= + -DCMAKE_INSTALL_LIBDIR:PATH= + -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} + -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET} + -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT} + ) + include(ExternalProject) ExternalProject_Add(zlib-project URL https://github.com/aseprite/zlib/archive/refs/tags/v1.2.12.zip @@ -133,13 +143,7 @@ if(NOT ZLIB_LIBRARIES) PREFIX "${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib" INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib" BUILD_BYPRODUCTS "${ZLIB_LIB_FILE}" - CMAKE_CACHE_ARGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH= - -DCMAKE_INSTALL_LIBDIR:PATH= - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET} - -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}) + CMAKE_CACHE_ARGS ${LAF_ARGS_FOR_EXTERNAL_PROJECT}) ExternalProject_Get_Property(zlib-project install_dir) set(ZLIB_INCLUDE_DIRS ${install_dir})