forked from AllentDan/LibtorchSegmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
35 lines (27 loc) · 1012 Bytes
/
CMakeLists.txt
File metadata and controls
35 lines (27 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.10)
project(LibtorchSegmentation)
set(CMAKE_CXX_STANDARD 14)
find_package(OpenCV REQUIRED)
include_directories(
${OpenCV_INCLUDE_DIRS}
)
find_package(OpenCV REQUIRED)
include_directories(include)
# set(CMAKE_PREFIX_PATH "/path2libtorch")
set(Torch_DIR $ENV{Torch_DIR}/share/cmake/Torch)
find_package(Torch REQUIRED)
if (Torch_FOUND)
message(STATUS "Torch library found!")
else ()
message(FATAL_ERROR "Could not locate Torch" \n)
endif()
include_directories(
${PROJECT_SOURCE_DIR}/include
)
FILE(GLOB ALL_SOURCES "*.cpp" "./src/*.cpp" "./src/architectures/*.cpp" "./src/backbones/*.cpp" "./src/utils/*.cpp" )
add_executable(LibtorchSegmentation src/main.cpp ${ALL_SOURCES})
target_link_libraries(LibtorchSegmentation ${OpenCV_LIBS})
target_link_libraries(LibtorchSegmentation ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_cudart_static_LIBRARY} ${OpenCV_LIBS})
target_link_libraries(LibtorchSegmentation
${TORCH_LIBRARIES}
)