cmakelist

cmake_minimum_required(VERSION 3.5)

project(libtorch LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(Torch_DIR /home/ljt/libtorch/share/cmake/Torch)
find_package(Torch REQUIRED)

add_executable(libtorch main.cpp)

target_link_libraries(libtorch "${TORCH_LIBRARIES}")

set_property(TARGET libtorch PROPERTY CXX_STANDARD 17)

set(OpenCV_DIR /home/ljt/OPENCV/opencv-3.4.7/build)

find_package(OpenCV REQUIRED)

target_link_libraries(libtorch {TORCH_LIBRARIES} )

你可能感兴趣的:(cmakelist)