diff --git a/src/cmake/Modules/FindTileDB_EP.cmake b/src/cmake/Modules/FindTileDB_EP.cmake index 8f7761b65..5fdbc505f 100644 --- a/src/cmake/Modules/FindTileDB_EP.cmake +++ b/src/cmake/Modules/FindTileDB_EP.cmake @@ -55,11 +55,17 @@ else() SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.3/tiledb-windows-x86_64-2.16.3-194b5ae.zip") SET(DOWNLOAD_SHA1 "8e986b6143ef9509201c7f2b3c0a7a53ff41095a") elseif(APPLE) # OSX + if (DEFINED CMAKE_OSX_ARCHITECTURES) + set(ACTUAL_TARGET ${CMAKE_OSX_ARCHITECTURES}) + else() + set(ACTUAL_TARGET ${CMAKE_SYSTEM_PROCESSOR}) + endif() + - if (CMAKE_OSX_ARCHITECTURES STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)") + if (ACTUAL_TARGET MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)") SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.3/tiledb-macos-x86_64-2.16.3-194b5ae.tar.gz") SET(DOWNLOAD_SHA1 "b4d35306771d1c30b49bf2a98651e8e24c91037e") - elseif (CMAKE_OSX_ARCHITECTURES STREQUAL arm64 OR CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") + elseif (ACTUAL_TARGET STREQUAL arm64 OR ACTUAL_TARGET MATCHES "^aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.16.3/tiledb-macos-arm64-2.16.3-194b5ae.tar.gz") SET(DOWNLOAD_SHA1 "1f3f0e7660ed54b8988bdfcc4876021bf57d58da") endif()