Files
geant4/examples/extended/parameterisations/Par04/cmake/FindOnnxRuntime.cmake
2025-06-26 09:17:29 +02:00

28 lines
933 B
CMake

# Find the ONNX Runtime include directory and library.
#
# This module defines the `onnxruntime` imported target that encodes all
# necessary information in its target properties.
find_library(
OnnxRuntime_LIBRARY
NAMES onnxruntime
PATH_SUFFIXES lib lib32 lib64
DOC "The ONNXRuntime library")
find_path(
OnnxRuntime_INCLUDE_DIR
NAMES onnxruntime_cxx_api.h
PATH_SUFFIXES include include/onnxruntime include/core/session
DOC "The ONNXRuntime include directory")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
OnnxRuntime
REQUIRED_VARS OnnxRuntime_LIBRARY OnnxRuntime_INCLUDE_DIR)
add_library(OnnxRuntime SHARED IMPORTED)
set_property(TARGET OnnxRuntime PROPERTY IMPORTED_LOCATION ${OnnxRuntime_LIBRARY})
set_property(TARGET OnnxRuntime PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${OnnxRuntime_INCLUDE_DIR})
mark_as_advanced(OnnxRuntime_FOUND OnnxRuntime_INCLUDE_DIR OnnxRuntime_LIBRARY)