-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (35 loc) · 1.71 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
43
44
cmake_minimum_required(VERSION 2.8.11)
project(cuda_jpeg_encode)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# find_package( OpenCV REQUIRED )
#include( $ENV{OpenCV3_DIR}/OpenCVConfig.cmake )
include(/home/deepmotion/dongxu/libs/ocv/install/share/OpenCV/OpenCVConfig.cmake)
#include(/data/dinghao/MyLibs/opencv_cu100_jp_turbo/share/OpenCV/OpenCVConfig.cmake)
message( STATUS "OpenCV library status:" )
message( STATUS " version: ${OpenCV_VERSION}" )
message( STATUS " libraries: ${OpenCV_LIBS}" )
message( STATUS " include path: ${OpenCV_INCLUDE_DIRS}" )
include_directories( ${OpenCV_INCLUDE_DIRS} )
#find_package(CUDA)
set(py_root "/home/deepmotion/miniconda3/envs/t1/")
set(PYTHON_LIBRARY "${py_root}/lib/libpython3.6m.so")
set(PYTHON_INCLUDE "${py_root}/include/")
find_package(PythonLibs 3.6 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
#find_package( gpujpeg REQUIRED )
include_directories( /usr/local/include/libgpujpeg/ )
include_directories( ./include )
# cpp example
cuda_add_executable( encode src/encode.cpp )
target_link_libraries( encode ${OpenCV_LIBS} gpujpeg)
cuda_add_executable( decode src/decode.cpp )
target_link_libraries( decode ${OpenCV_LIBS} gpujpeg)
# python binding
add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/third_party/pybind11 )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/third_party/pybind11/include )
cuda_add_library(GPUJPEG_Encoder SHARED src/encode_pybind.cpp )
target_link_libraries(GPUJPEG_Encoder ${OpenCV_LIBS} gpujpeg)
set_target_properties(GPUJPEG_Encoder PROPERTIES PREFIX "")
cuda_add_library(GPUJPEG_Decoder SHARED src/decode_pybind.cpp )
target_link_libraries(GPUJPEG_Decoder ${OpenCV_LIBS} gpujpeg)
set_target_properties(GPUJPEG_Decoder PROPERTIES PREFIX "")