Azure / azure-sdk-for-cpp

This repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-cpp.
MIT License
181 stars 126 forks source link

Section "CMake Project + fetch content " in README.md #4430

Open chspeck opened 1 year ago

chspeck commented 1 year ago

Query/Question The section "CMake Project + fetch content" suggests to use CMAKE_FETCH_CONTENT to integrate the sdk in my project. We dont have vcpkg. When doing as instructed:

FetchContent_Declare(
    azuresdk
    GIT_REPOSITORY      https://github.com/Azure/azure-sdk-for-cpp.git
#    GIT_TAG             2850c5d32c8a86491b49e801433b8f186fa81745
    GIT_TAG             c3dc7321577fa99ddbf473fdf2a9454c2e388702
)

FetchContent_GetProperties(azuresdk)
if(NOT azuresdk_POPULATED)
    FetchContent_Populate(azuresdk)
    # Adding all Azure SDK libraries
    # add_subdirectory(${azuresdk_SOURCE_DIR} ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)
    # Adding one Azure SDK Library only (Storage blobs)
    add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/storage/azure-storage-blobs ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)

    #add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/core/azure-core ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

I get the error:

-- Configuring incomplete, errors occurred!
Vcpkg integrate step.
CMAKE_TOOLCHAIN_FILE is not defined. Define it for the user.
AZURE_SDK_DISABLE_AUTO_VCPKG is not defined. Fetch a local copy of vcpkg.
Vcpkg commit string used: 94ce0dab56f4d8ba6bd631ba59ed682b02d45c46
No transport adapter was selected, using libcurl as the default option for POSIX.
CMake Error at /......../_deps/azuresdk-src/sdk/storage/azure-storage-blobs/CMakeLists.txt:37 (find_package):
  By not providing "Findazure-storage-common-cpp.cmake" in CMAKE_MODULE_PATH
  this project has asked CMake to find a package configuration file provided
  by "azure-storage-common-cpp", but CMake did not find one.

  Could not find a package configuration file provided by
  "azure-storage-common-cpp" (requested version 12.3.0) with any of the
  following names:

    azure-storage-common-cppConfig.cmake
    azure-storage-common-cpp-config.cmake

  Add the installation prefix of "azure-storage-common-cpp" to
  CMAKE_PREFIX_PATH or set "azure-storage-common-cpp_DIR" to a directory
  containing one of the above files.  If "azure-storage-common-cpp" provides
  a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!

When just adding azure-core it works. My try to include the azure-storage is even smaller as the sample in REAMDE.md that includes the whole sdk.

Many thanks in advance for clarification and support.

Why is this not a Bug or a feature Request? I assume I did misunderstood or overlooked something. Maybe a clarification in the README.md would be helpful for others as well.

Setup (please complete the following information if applicable):

Jinming-Hu commented 1 year ago

@RickWinter we need to check if the getting-started steps in README have stopped working for some reason.