-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (34 loc) · 1.55 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
# CMakeList.txt : CMake project for Stereo Depth Perception, include source and define
# project specific logic here.
#
CMAKE_MINIMUM_REQUIRED (VERSION 3.10)
PROJECT ("StereoDepthPerception" LANGUAGES CXX CUDA)
FIND_PACKAGE( OpenCV REQUIRED )
INCLUDE_DIRECTORIES( ${OpenCV_INCLUDE_DIRS} )
FIND_PACKAGE(CUDA REQUIRED)
INCLUDE_DIRECTORIES( ${CUDA_INCLUDE_DIRS})
# ADD LIBRARY
ADD_SUBDIRECTORY("lib")
# Add source to this project's executable.
ADD_EXECUTABLE(StereoDepthPerception
"main.cpp"
)
message(STATUS "CUDA LIBRARIES: ${CUDA_LIBRARIES}")
message(STATUS "CUDA CUBLAS LIBRARIES: ${CUDA_CUBLAS_LIBRARIES}")
TARGET_LINK_LIBRARIES(StereoDepthPerception ${OpenCV_LIBS})
TARGET_LINK_LIBRARIES(StereoDepthPerception "StereoDepthPerceptionLib" ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
# Post-build event
if(UNIX AND NOT APPLE)
# Linux, BSD, Solaris, Minix
set(LIB_NAME "StereoDepthPerceptionLib.a")
set(EXTERNAL_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/release/linux/${LIB_NAME}")
add_custom_command(TARGET StereoDepthPerception POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:StereoDepthPerceptionLib> ${EXTERNAL_LIBS}
COMMENT "Created ${EXTERNAL_LIBS}")
elseif(WIN32)
set(LIB_NAME "StereoDepthPerceptionLib.lib")
set(EXTERNAL_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/release/windows/${LIB_NAME}")
add_custom_command(TARGET StereoDepthPerception POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:StereoDepthPerceptionLib> ${EXTERNAL_LIBS}
COMMENT "Created ${EXTERNAL_LIBS}")
endif()