-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
36 lines (26 loc) · 1.23 KB
/
CMakeLists.txt
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
36
cmake_minimum_required( VERSION 3.1)
project( UNet )
set( CMAKE_PREFIX_PATH /mnt/c/Users/Youssef/Desktop/CPP/libtorch )
set( CMAKE_INSTALL_PREFIX /usr/local)
set( CMAKE_BUILD_TYPE Release)
# set(OPENCV_EXTRA_MODULES_PATH /mnt/c/Users/Youssef/Desktop/CPP/opencv-cpp/opencv_contrib/modules)
# We don't have that now
set( CMAKE_CXX_STANDARD 11)
set( CMAKE_CXX_STANDARD_REQUIRED TRUE)
find_package( OpenCV REQUIRED )
find_package( Torch REQUIRED)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
# If the package has been found, several variables will
# be set, you can find the full list with descriptions
# in the OpenCVConfig.cmake file.
# Print some message showing some of them
message( STATUS "OpenCV library status:")
message( STATUS " >> config: ${OpenCV_DIR}")
message( STATUS " >> version: ${OpenCV_VERSION}")
message( STATUS " >> libraries: ${OpenCV_LIBS}")
message( STATUS " >> include path: ${OpenCV_INCLUDE_DIRS}")
include_directories( ${OpenCV_INCLUDE_DIRS})
add_executable( ${PROJECT_NAME} main.cpp )
target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS})
target_link_libraries( ${PROJECT_NAME} "${TORCH_LIBRARIES}")
set_property( TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)