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
-
5
1
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)
9
13
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} " )
10
19
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 )
17
22
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)
20
26
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)
23
28
24
- endif (NOT DOWNLOAD_RESULT EQUAL 0)
25
29
endif (DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL)
0 commit comments