-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
42 lines (35 loc) · 1.25 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
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.12.3 FATAL_ERROR)
PROJECT ("MRCNN_EXAMPLE")
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/libtorch)
# if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0)
# message("ABI SET 0")
# set(MRCN_ABI_FLAG "CMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
# endif()
find_package(Torch REQUIRED)
find_package(CUDA)
find_package(OpenCV REQUIRED)
# if(NOT OpenCV_FOUND)
# execute_process (
# COMMAND bash -c
# COMMAND bash -c "./lib/opencv"
# OUTPUT_VARIABLE outVar
# )
# endif()
if(CUDA_FOUND)
message("CUDA FOUND")
enable_language(CUDA)
set(CUDA_STANDARD 11)
set(CUDA_STANDARD_REQUIRED ON)
string(APPEND CMAKE_CUDA_FLAGS "-DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -std=c++11")
endif()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/gtest)
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/monodepth)
add_executable(monodepth2
runner.cpp)
target_link_libraries(monodepth2 depth)