You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the currently documented approach for obtaining this tool, a failed download results in an empty file called conan.cmake in the build directory:
list(APPENDCMAKE_MODULE_PATH${CMAKE_BINARY_DIR})
# Some lines skipped.if(NOTEXISTS"${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS"Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.16.1/conan.cmake""${CMAKE_BINARY_DIR}/conan.cmake"EXPECTED_HASH SHA256=396e16d0f5eabdc6a14afddbcfff62a54a7ee75c6da23f32f7a31bc85db23484
TLS_VERIFYON)
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
This means that a second run of the same CMake script, now with a working Internet connection, will also fail:
CMake Error at Generics.cmake:308 (conan_cmake_run):
Unknown CMake command"conan_cmake_run".
The existence check for ${CMAKE_BINARY_DIR}/conan.cmake now succeeds on the empty file, and the include statement succeeds too. But none of the CMake/Conan features are available in that included empty file, so the conan_cmake_run statement will fail.
Expected
I expect a failing downloading to be handled gracefully. CMake seems to have facilities for this that check the HTTP status code and allow cleanup actions based on an observed error status code.
Suggestion
I currently use the following snippet instead of the one included in the README of this project to cleanup after a failed download (I'm using the latest version in this snippet):
Observed
With the currently documented approach for obtaining this tool, a failed download results in an empty file called
conan.cmake
in the build directory:This means that a second run of the same CMake script, now with a working Internet connection, will also fail:
The existence check for
${CMAKE_BINARY_DIR}/conan.cmake
now succeeds on the empty file, and theinclude
statement succeeds too. But none of the CMake/Conan features are available in that included empty file, so theconan_cmake_run
statement will fail.Expected
I expect a failing downloading to be handled gracefully. CMake seems to have facilities for this that check the HTTP status code and allow cleanup actions based on an observed error status code.
Suggestion
I currently use the following snippet instead of the one included in the README of this project to cleanup after a failed download (I'm using the latest version in this snippet):
The text was updated successfully, but these errors were encountered: