2018-11-20 00:48:22 +00:00
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
set ( CSHARP_ROOT ${ PROJECT_SOURCE_DIR } /../csharp )
set ( CSHARP_MASTER_TARGET OnnxRuntime.CSharp )
2019-04-11 01:16:02 +00:00
set ( CSHARP_MASTER_PROJECT ${ CSHARP_ROOT } /OnnxRuntime.CSharp.proj )
if ( onnxruntime_RUN_ONNX_TESTS )
set ( CSHARP_DEPENDS onnxruntime ${ test_data_target } )
else ( )
set ( CSHARP_DEPENDS onnxruntime )
endif ( )
2019-09-09 18:17:44 +00:00
if ( onnxruntime_USE_CUDA )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_CUDA," )
endif ( )
2019-12-03 15:34:23 +00:00
if ( onnxruntime_USE_DNNL )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_DNNL," )
2019-09-09 18:17:44 +00:00
endif ( )
if ( onnxruntime_USE_TENSORRT )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_TENSORRT," )
endif ( )
2020-05-26 20:24:59 +00:00
if ( onnxruntime_USE_MIGRAPHX )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_MIGRAPHX," )
endif ( )
2019-09-09 18:17:44 +00:00
if ( onnxruntime_USE_OPENVINO )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_OPENVINO," )
endif ( )
if ( onnxruntime_USE_NGRAPH )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_NGRAPH," )
endif ( )
if ( onnxruntime_USE_NUPHAR )
STRING ( APPEND CSHARP_PREPROCESSOR_DEFINES "USE_NUPHAR," )
endif ( )
2018-11-20 00:48:22 +00:00
include ( CSharpUtilities )
2019-11-08 17:45:52 +00:00
include_external_msproject ( Microsoft.ML.OnnxRuntime
$ { C S H A R P _ R O O T } / s r c / M i c r o s o f t . M L . O n n x R u n t i m e / M i c r o s o f t . M L . O n n x R u n t i m e . c s p r o j
2019-09-09 18:17:44 +00:00
$ { C S H A R P _ D E P E N D S }
2018-11-20 00:48:22 +00:00
)
2019-01-12 01:24:54 +00:00
2019-11-08 17:45:52 +00:00
include_external_msproject ( Microsoft.ML.OnnxRuntime.InferenceSample
$ { C S H A R P _ R O O T } / s a m p l e / M i c r o s o f t . M L . O n n x R u n t i m e . I n f e r e n c e S a m p l e / M i c r o s o f t . M L . O n n x R u n t i m e . I n f e r e n c e S a m p l e . c s p r o j
$ { C S H A R P _ D E P E N D S }
)
include_external_msproject ( Microsoft.ML.OnnxRuntime.Tests
$ { C S H A R P _ R O O T } / t e s t / M i c r o s o f t . M L . O n n x R u n t i m e . T e s t s / M i c r o s o f t . M L . O n n x R u n t i m e . T e s t s . c s p r o j
$ { C S H A R P _ D E P E N D S }
)
include_external_msproject ( Microsoft.ML.OnnxRuntime.PerfTool
$ { C S H A R P _ R O O T } / t o o l s / M i c r o s o f t . M L . O n n x R u n t i m e . P e r f T o o l / M i c r o s o f t . M L . O n n x R u n t i m e . P e r f T o o l . c s p r o j
$ { C S H A R P _ D E P E N D S }
)
#Exclude them from the ALL_BUILD target, otherwise it will trigger errors like:
#"Error : Project 'cmake\..\csharp\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj' targets 'netstandard1.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.0'."
#We can't fix it because cmake only supports the "TargetFrameworkVersion" property, not "TargetFramework".
set_target_properties ( Microsoft.ML.OnnxRuntime Microsoft.ML.OnnxRuntime.InferenceSample Microsoft.ML.OnnxRuntime.Tests Microsoft.ML.OnnxRuntime.PerfTool PROPERTIES EXCLUDE_FROM_ALL 1 )
2019-01-12 01:24:54 +00:00
# generate Directory.Build.props
set ( DIRECTORY_BUILD_PROPS_COMMENT "WARNING: This is a generated file, please do not check it in!" )
configure_file ( ${ CSHARP_ROOT } /Directory.Build.props.in
$ { C S H A R P _ R O O T } / D i r e c t o r y . B u i l d . p r o p s
@ O N L Y )