Skip to content

Commit 3a1fded

Browse files
committed
Formating configuration
1 parent 2d85b9a commit 3a1fded

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

cmake/download_onnxruntime.cmake

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
# Define the download and extraction paths)
2-
set(DOWNLOAD_PATH "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime.zip")
3-
set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime")
4-
51
if(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL)
6-
message(NOTICE "Downloading onnxruntime: ${TRITON_ONNXRUNTIME_PACKAGE_URL}")
7-
# Download the file
8-
file(DOWNLOAD ${TRITON_ONNXRUNTIME_PACKAGE_URL} ${DOWNLOAD_PATH} SHOW_PROGRESS STATUS DOWNLOAD_STATUS)
2+
# Define the download and extraction paths)
3+
set(DOWNLOAD_PATH "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime.zip")
4+
set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime")
5+
6+
message(NOTICE "Downloading onnxruntime: ${TRITON_ONNXRUNTIME_PACKAGE_URL}")
7+
8+
# Download the file
9+
file(DOWNLOAD ${TRITON_ONNXRUNTIME_PACKAGE_URL} ${DOWNLOAD_PATH} SHOW_PROGRESS STATUS DOWNLOAD_STATUS)
10+
11+
# Check the download status
12+
list(GET DOWNLOAD_STATUS 0 DOWNLOAD_RESULT)
913

14+
# Extract the downloaded file if the download was successful
15+
if(NOT DOWNLOAD_RESULT EQUAL 0)
16+
message(NOTICE "Failed to download: ${TRITON_ONNXRUNTIME_PACKAGE_URL}")
17+
else()
18+
message(NOTICE "Download successful: ${DOWNLOAD_PATH}" )
1019

11-
# Check the download status
12-
list(GET DOWNLOAD_STATUS 0 DOWNLOAD_RESULT)
13-
if(NOT DOWNLOAD_RESULT EQUAL 0)
14-
message(NOTICE "Failed to download: ${TRITON_ONNXRUNTIME_PACKAGE_URL}")
15-
else()
16-
message(NOTICE "Download successful: ${DOWNLOAD_PATH}" )
20+
# Extract the downloaded file
21+
file(ARCHIVE_EXTRACT INPUT ${DOWNLOAD_PATH} DESTINATION ${EXTRACT_DIR} VERBOSE )
1722

18-
# Extract the downloaded file
19-
file(ARCHIVE_EXTRACT INPUT ${DOWNLOAD_PATH} DESTINATION ${EXTRACT_DIR} VERBOSE )
23+
# Update CMakeLists.txt configuration references with new values
24+
set(TRITON_ONNXRUNTIME_INCLUDE_PATHS ${EXTRACT_DIR}/include)
25+
set(TRITON_ONNXRUNTIME_LIB_PATHS ${EXTRACT_DIR}/lib)
2026

21-
set(TRITON_ONNXRUNTIME_INCLUDE_PATHS ${EXTRACT_DIR}/include)
22-
set(TRITON_ONNXRUNTIME_LIB_PATHS ${EXTRACT_DIR}/lib)
27+
endif(NOT DOWNLOAD_RESULT EQUAL 0)
2328

24-
endif(NOT DOWNLOAD_RESULT EQUAL 0)
2529
endif(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL)

0 commit comments

Comments
 (0)