|
|
|
@ -39,6 +39,7 @@ set(INSTALL_INCLUDE_DIR "include/darknet" CACHE PATH "Path where head |
|
|
|
|
set(INSTALL_CMAKE_DIR "share/darknet" CACHE PATH "Path where cmake configs will be installed") |
|
|
|
|
|
|
|
|
|
set(ENABLE_OPENCV "TRUE" CACHE BOOL "Enable OpenCV integration") |
|
|
|
|
set(SELECT_OPENCV_MODULES "TRUE" CACHE BOOL "Use only few selected OpenCV modules to circumvent some Ninja+CMake bugs on Windows") |
|
|
|
|
set(ENABLE_CUDA "TRUE" CACHE BOOL "Enable CUDA support") |
|
|
|
|
set(ENABLE_CUDNN "FALSE" CACHE BOOL "Enable CUDNN") |
|
|
|
|
set(ENABLE_CUDNN_HALF "FALSE" CACHE BOOL "Enable CUDNN Half precision") |
|
|
|
@ -84,14 +85,12 @@ endif() |
|
|
|
|
if(ENABLE_OPENCV) |
|
|
|
|
find_package(OpenCV) |
|
|
|
|
if(OpenCV_FOUND) |
|
|
|
|
if(SELECT_OPENCV_MODULES) |
|
|
|
|
if(TARGET opencv_world) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_world") |
|
|
|
|
else() |
|
|
|
|
if(TARGET opencv_video) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_video") |
|
|
|
|
endif() |
|
|
|
|
if(TARGET opencv_videoio) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_videoio") |
|
|
|
|
if(TARGET opencv_core) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_core") |
|
|
|
|
endif() |
|
|
|
|
if(TARGET opencv_highgui) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_highgui") |
|
|
|
@ -99,13 +98,22 @@ if(ENABLE_OPENCV) |
|
|
|
|
if(TARGET opencv_imgproc) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_imgproc") |
|
|
|
|
endif() |
|
|
|
|
if(TARGET opencv_video) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_video") |
|
|
|
|
endif() |
|
|
|
|
if(TARGET opencv_videoio) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_videoio") |
|
|
|
|
endif() |
|
|
|
|
if(TARGET opencv_imgcodecs) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_imgcodecs") |
|
|
|
|
endif() |
|
|
|
|
if(TARGET opencv_core) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_core") |
|
|
|
|
if(TARGET opencv_text) |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS "opencv_text") |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
else() |
|
|
|
|
list(APPEND OpenCV_LINKED_COMPONENTS ${OpenCV_LIBS}) |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
find_package(Stb REQUIRED) |
|
|
|
@ -305,7 +313,7 @@ target_compile_definitions(uselib PRIVATE -DUSE_CMAKE_LIBS) |
|
|
|
|
|
|
|
|
|
if(CUDNN_FOUND) |
|
|
|
|
target_link_libraries(darknet PRIVATE CuDNN::CuDNN) |
|
|
|
|
target_link_libraries(dark PUBLIC CuDNN::CuDNN) |
|
|
|
|
target_link_libraries(dark PRIVATE CuDNN::CuDNN) |
|
|
|
|
target_compile_definitions(darknet PRIVATE -DCUDNN) |
|
|
|
|
target_compile_definitions(dark PUBLIC -DCUDNN) |
|
|
|
|
if(ENABLE_CUDNN_HALF) |
|
|
|
@ -364,7 +372,7 @@ if(ENABLE_CUDA) |
|
|
|
|
target_include_directories(darknet PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) |
|
|
|
|
target_include_directories(dark PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) |
|
|
|
|
target_link_libraries(darknet PRIVATE curand cublas cuda) |
|
|
|
|
target_link_libraries(dark PUBLIC curand cublas cuda) |
|
|
|
|
target_link_libraries(dark PRIVATE curand cublas cuda) |
|
|
|
|
set_target_properties(dark PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON) |
|
|
|
|
target_compile_definitions(darknet PRIVATE -DGPU) |
|
|
|
|
target_compile_definitions(dark PUBLIC -DGPU) |
|
|
|
|