Skip to content

Commit

Permalink
If certificates download fails, bail out
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 5, 2023
1 parent d54c8f1 commit df2bfc0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,12 @@ if(WITH_VCPKG)
)
endforeach()

# Using file(DOWNLOAD) to use https
file(DOWNLOAD https://curl.se/ca/cacert.pem "${CMAKE_BINARY_DIR}/cacert.pem" TLS_VERIFY ON)
file(DOWNLOAD https://curl.se/ca/cacert.pem "${CMAKE_BINARY_DIR}/cacert.pem" TLS_VERIFY ON STATUS DOWNLOAD_STATUS)
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
if(NOT ${STATUS_CODE} EQUAL 0)
message(FATAL_ERROR "Error occurred during download: ${ERROR_MESSAGE}")
endif()

add_custom_command(TARGET deploy
POST_BUILD
Expand Down

1 comment on commit df2bfc0

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.