File: CMakeLists.txt

package info (click to toggle)
pytorch-vision 0.24.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 21,844 kB
  • sloc: python: 70,433; cpp: 11,502; ansic: 2,588; java: 550; sh: 317; xml: 79; objc: 56; makefile: 33
file content (18 lines) | stat: -rw-r--r-- 454 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cmake_minimum_required(VERSION 3.10)
project(run_model)

option(USE_TORCHVISION "Whether to link to torchvision" OFF)

find_package(Torch REQUIRED)
if(USE_TORCHVISION)
  find_package(TorchVision REQUIRED)
endif()

add_executable(run_model run_model.cpp)

target_link_libraries(run_model "${TORCH_LIBRARIES}")
if(USE_TORCHVISION)
  target_link_libraries(run_model TorchVision::TorchVision)
endif()

set_property(TARGET run_model PROPERTY CXX_STANDARD 17)