Skip to content

Commit

Permalink
Refactor external project arguments to use a list instead
Browse files Browse the repository at this point in the history
  • Loading branch information
martincapello committed Nov 30, 2023
1 parent d15efc0 commit b8edff5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions cmake/FindSkia.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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=<INSTALL_DIR>
-DCMAKE_INSTALL_LIBDIR:PATH=<INSTALL_DIR>
-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
Expand All @@ -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=<INSTALL_DIR>
-DCMAKE_INSTALL_LIBDIR:PATH=<INSTALL_DIR>
-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})
Expand Down

0 comments on commit b8edff5

Please sign in to comment.