Skip to content

Commit

Permalink
broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir-Rashid committed Oct 26, 2023
1 parent 4498570 commit 218a949
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ set(DEPS_DIRECTORY ${PROJECT_SOURCE_DIR}/deps)

add_subdirectory(${DEPS_DIRECTORY}/arena-sdk)
add_subdirectory(${DEPS_DIRECTORY}/json)
add_subdirectory(${DEPS_DIRECTORY}/opencv)
# add_subdirectory(${DEPS_DIRECTORY}/torch)
# add_subdirectory(${DEPS_DIRECTORY}/opencv)
add_subdirectory(${DEPS_DIRECTORY}/torch)
# =============================

# =============================
Expand Down
1 change: 1 addition & 0 deletions deps/opencv/CMakeLists.txt.stackoverflow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# https://github.com/opencv/opencv/issues/20548
include(FetchContent)
FetchContent_Declare(
opencv
Expand Down
9 changes: 6 additions & 3 deletions deps/torch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
include(FetchContent)
Set(FETCHCONTENT_QUIET FALSE)

# https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent
FetchContent_Declare(Torch
URL https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.1.0%2Bcpu.zip
)
# URL https://download.pytorch.org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip

FetchContent_MakeAvailable(Torch)
# find_package(Torch REQUIRED)

# message(FATAL_ERROR ${CMAKE_BINARY_DIR})
set(Torch_DIR "${CMAKE_BINARY_DIR}/_deps/torch-src/share/cmake/Torch/")
find_package(Torch REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")

target_link_libraries(${PROJECT_NAME} PRIVATE
"${TORCH_LIBRARIES}"
)
include_directories(SYSTEM ${TORCH_INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PRIVATE ${TORCH_INCLUDE_DIRS})

# find_package(Torch REQUIRED)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
Expand Down

0 comments on commit 218a949

Please sign in to comment.