Following https://pytorch.org/cppdocs/installing.html, I have
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(example-app)
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
include_directories(
"${TORCH_INCLUDE_DIRS}" # libtorch headers
)
add_executable(example-app example-app.cpp)
target_link_libraries(example-app "${TORCH_LIBRARIES}")
set_property(TARGET example-app PROPERTY CXX_STANDARD 14)
This works but links to the shared Torch libraries; how can I link to the static ones instead?