Skip to content

Commit

Permalink
Functional FindAzure.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Aug 15, 2023
1 parent 8301e0f commit e705192
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions cpp/cmake_modules/FindAzure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,26 @@ if(Azure_FOUND)
return()
endif()

set(FIND_PACKAGE_ARGUMENTS)
list(APPEND FIND_PACKAGE_ARGUMENTS CONFIG)
set(find_package_args)
list(APPEND find_package_args
CONFIG
# Avoid finding cmake files in local copies of the Azure SDK for C++.
# e.g. the extracted copy from the previous build.
NO_CMAKE_PACKAGE_REGISTRY
)
if(Azure_FIND_QUIETLY)
list(APPEND find_package_args QUIET)
endif()

if(Azure_FIND_REQUIRED)
list(APPEND FIND_PACKAGE_ARGUMENTS REQUIRED)
list(APPEND find_package_args REQUIRED)
endif()

find_package(azure-core-cpp ${FIND_PACKAGE_ARGUMENTS})
find_package(azure-identity-cpp ${FIND_PACKAGE_ARGUMENTS})
find_package(azure-storage-blobs-cpp ${FIND_PACKAGE_ARGUMENTS})
find_package(azure-storage-common-cpp ${FIND_PACKAGE_ARGUMENTS})
find_package(azure-storage-files-datalake-cpp ${FIND_PACKAGE_ARGUMENTS})
find_package(azure-core-cpp ${find_package_args})
find_package(azure-identity-cpp ${find_package_args})
find_package(azure-storage-blobs-cpp ${find_package_args})
find_package(azure-storage-common-cpp ${find_package_args})
find_package(azure-storage-files-datalake-cpp ${find_package_args})

if(azure-core-cpp_FOUND AND azure-identity-cpp_FOUND AND azure-storage-blobs-cpp_FOUND
AND azure-storage-common-cpp_FOUND AND azure-storage-files-datalake-cpp_FOUND)
Expand Down

0 comments on commit e705192

Please sign in to comment.