forked from ganyc717/Darknet-On-OpenCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (28 loc) · 904 Bytes
/
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 2.8)
set(CMAKE_CXX_FLAGS "-std=c++11 -O2 -DNDEBUG " )
set(OPENCV ON)
set(GPU ON)
set(BUILDLIB OFF)
find_package(OpenCL)
find_package(OpenCV)
if (OpenCL_FOUND AND GPU)
ADD_DEFINITIONS(-DGPU=1)
include_directories(${OpenCL_INCLUDE_DIR})
link_libraries(${OpenCL_LIBRARY})
link_libraries(${PROJECT_SOURCE_DIR}/darknet_cl/clBLAS/libclBLAS.so)
endif()
if (OpenCV_FOUND AND OPENCV)
ADD_DEFINITIONS(-DOPENCV)
include_directories(${OpenCV_INCLUDE_DIR})
link_libraries(${OpenCV_LIBRARIES})
endif()
aux_source_directory(./darknet_cl/src DIR_LIB_SRC)
aux_source_directory(./darknet_cl/example DIR_EXAMPLE_SRC)
include_directories(./darknet_cl/include)
include_directories(./darknet_cl/clBLAS)
link_libraries(libpthread.so)
if (BUILDLIB)
add_library(darknet SHARED ${DIR_LIB_SRC})
else(BUILDLIB)
add_executable(darknet ${DIR_LIB_SRC} ${DIR_EXAMPLE_SRC})
endif()