File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ if(${onnxruntime_FOUND})
15
15
set (onnxruntime_LIBRARIES onnxruntime::onnxruntime )
16
16
get_filename_component (onnxruntime_INSTALL_PREFIX "${onnxruntime_INCLUDE_DIR} /../../" ABSOLUTE )
17
17
find_library (onnxruntime_LIBRARY onnxruntime PATHS "${onnxruntime_INSTALL_PREFIX} /lib" )
18
- set_target_properties (${onnxruntime_LIBRARIES} PROPERTIES IMPORTED_LOCATION "${onnxruntime_LIBRARY} " )
19
- set_target_properties (${onnxruntime_LIBRARIES} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_INCLUDE_DIR} " )
18
+ set_target_properties (${onnxruntime_LIBRARIES}
19
+ PROPERTIES
20
+ IMPORTED_LOCATION "${onnxruntime_LIBRARY} "
21
+ INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_INCLUDE_DIR} " )
20
22
endif ()
21
23
22
24
if (NOT ${onnxruntime_FOUND} )
@@ -48,7 +50,10 @@ if(NOT ${onnxruntime_FOUND})
48
50
set (onnxruntime_LIBRARY_DIR "${onnxruntime_DIR} /lib" )
49
51
set (onnxruntime_LIBRARIES onnxruntime::onnxruntime )
50
52
add_library (${onnxruntime_LIBRARIES} SHARED IMPORTED GLOBAL )
51
- set_target_properties (${onnxruntime_LIBRARIES} PROPERTIES IMPORTED_LOCATION ${onnxruntime_LIBRARY_DIR} /libonnxruntime.so )
53
+ set_target_properties (${onnxruntime_LIBRARIES}
54
+ PROPERTIES
55
+ IMPORTED_LOCATION ${onnxruntime_LIBRARY_DIR} /libonnxruntime.so
56
+ INTERFACE_INCLUDE_DIRECTORIES ${onnxruntime_INCLUDE_DIR} )
52
57
set (onnxruntime_FOUND TRUE )
53
58
endif ()
54
59
Original file line number Diff line number Diff line change 1
1
get_filename_component (sopt_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE} " PATH )
2
2
message (STATUS "Linking to sopt package in ${sopt_CMAKE_DIR} " )
3
3
set (sopt_INCLUDE_DIR "@ALL_INCLUDE_DIRS@" )
4
+
5
+ if (onnxrt )
6
+ # try and find ORT from the environment
7
+ find_package (onnxruntime QUIET )
8
+ if (NOT ${onnxruntime_FOUND} )
9
+ # if not found, it was installed on the fly
10
+ set (onnxruntime_LIBRARIES onnxruntime::onnxruntime )
11
+ add_library (${onnxruntime_LIBRARIES} SHARED IMPORTED GLOBAL )
12
+ set_target_properties (${onnxruntime_LIBRARIES}
13
+ PROPERTIES
14
+ IMPORTED_LOCATION "@onnxruntime_DIR@/lib/libonnxruntime.so"
15
+ INTERFACE_INCLUDE_DIRECTORIES "@onnxruntime_INCLUDE_DIR@" )
16
+ endif ()
17
+ endif ()
18
+
4
19
if (NOT TARGET libsopt AND EXISTS "${sopt_CMAKE_DIR} /soptCTargets.cmake" )
5
20
include ("${sopt_CMAKE_DIR} /soptCTargets.cmake" )
6
21
endif ()
You can’t perform that action at this time.
0 commit comments