CMakeLists.txt 640 B

1234567891011121314151617181920212223
  1. cmake_minimum_required(VERSION 3.4.1)
  2. set(TARGET torchvision_ops)
  3. project(${TARGET} CXX)
  4. set(CMAKE_CXX_STANDARD 17)
  5. set(LIBTORCH_HEADER_ROOT ${LIBTORCH_HEADER_ROOT})
  6. set(LIBRARY_OUTPUT_PATH ../lib)
  7. file(GLOB VISION_SRCS
  8. ../torchvision/csrc/ops/cpu/*.h
  9. ../torchvision/csrc/ops/cpu/*.cpp
  10. ../torchvision/csrc/ops/*.h
  11. ../torchvision/csrc/ops/*.cpp)
  12. add_library(${TARGET} STATIC
  13. ${VISION_SRCS}
  14. )
  15. file(GLOB PYTORCH_HEADERS "${LIBTORCH_HEADER_ROOT}")
  16. file(GLOB PYTORCH_HEADERS_CSRC "${LIBTORCH_HEADER_ROOT}/torch/csrc/api/include")
  17. target_include_directories(${TARGET} PRIVATE
  18. ${PYTORCH_HEADERS}
  19. ${PYTORCH_HEADERS_CSRC}
  20. )