onnxruntime/samples/c_cxx/CMakeLists.txt
Sreekanth Yalachigere 31ea11a696 Renaming MKL-DNN as DNNL (#2515)
* DNNL: Moving Files to rename file names

* DNNL name change

* azure pipeline updated

* disable ceil/dialation and enable Opset10

* disable ceil/dialation tests in Python

* mlperf_ssd_resnet34_1200 disabled
2019-12-03 07:34:23 -08:00

92 lines
2.5 KiB
CMake

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.13)
# Project
project(onnxruntime_samples C CXX)
if (WIN32)
string(APPEND CMAKE_CXX_FLAGS " /W4")
else()
string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra")
string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
endif()
#onnxruntime providers
option(onnxruntime_USE_CUDA "Build with CUDA support" OFF)
option(onnxruntime_USE_OPENVINO "Build with OpenVINO support" OFF)
option(onnxruntime_USE_NNAPI "Build with DNNLibrary for Android NNAPI support" OFF)
option(onnxruntime_USE_DNNL "Build with DNNL support" OFF)
option(onnxruntime_USE_NGRAPH "Build with nGraph support" OFF)
option(onnxruntime_USE_NUPHAR "Build with Nuphar" OFF)
option(onnxruntime_USE_BRAINSLICE "Build with BrainSlice" OFF)
option(onnxruntime_USE_TENSORRT "Build with TensorRT support" OFF)
option(LIBPNG_ROOTDIR "libpng root dir")
option(ONNXRUNTIME_ROOTDIR "onnxruntime root dir")
if(NOT ONNXRUNTIME_ROOTDIR)
if(WIN32)
set(ONNXRUNTIME_ROOTDIR "C:/Program Files (x86)/onnxruntime")
else()
include_directories("/usr/local/include/onnxruntime")
endif()
endif()
if(WIN32)
include_directories("${ONNXRUNTIME_ROOTDIR}/include" "${ONNXRUNTIME_ROOTDIR}/include/onnxruntime/core/session")
link_directories("${ONNXRUNTIME_ROOTDIR}/lib")
endif()
#if JPEG lib is available, we'll use it for image decoding, otherwise we'll use WIC
find_package(JPEG)
if(LIBPNG_ROOTDIR)
set(PNG_FOUND true)
if(WIN32)
set(PNG_LIBRARIES debug libpng16_d optimized libpng16)
else()
set(PNG_LIBRARIES png16)
endif()
set(PNG_INCLUDE_DIRS "${LIBPNG_ROOTDIR}/include")
set(PNG_LIBDIR "${LIBPNG_ROOTDIR}/lib")
else()
find_package(PNG)
endif()
if(onnxruntime_USE_CUDA)
add_definitions(-DUSE_CUDA)
endif()
if(onnxruntime_USE_OPENVINO)
add_definitions(-DUSE_OPENVINO)
endif()
if(onnxruntime_USE_NNAPI)
add_definitions(-DUSE_NNAPI)
endif()
if(onnxruntime_USE_NNAPI)
add_definitions(-DUSE_NNAPI)
endif()
if(onnxruntime_USE_DNNL)
add_definitions(-DUSE_DNNL)
endif()
if(onnxruntime_USE_NGRAPH)
add_definitions(-DUSE_NGRAPH)
endif()
if(onnxruntime_USE_NUPHAR)
add_definitions(-DUSE_NUPHAR)
endif()
if(onnxruntime_USE_BRAINSLICE)
add_definitions(-DUSE_BRAINSLICE)
endif()
if(onnxruntime_USE_TENSORRT)
add_definitions(-DUSE_TENSORRT)
endif()
if(onnxruntime_USE_DML)
message("Enabling DML")
add_definitions(-DUSE_DML)
endif()
add_subdirectory(imagenet)
if(PNG_FOUND)
add_subdirectory(fns_candy_style_transfer)
endif()
add_subdirectory(MNIST)