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 fadc838 commit 63c3434
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 @@ -247,8 +247,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

0 comments on commit 63c3434

Please sign in to comment.