2019-03-04 22:15:19 +08:00
|
|
|
# Config file for the Darknet package
|
|
|
|
|
|
|
|
get_filename_component(Darknet_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
2019-03-14 05:56:44 +08:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${Darknet_CMAKE_DIR}")
|
2019-03-04 22:15:19 +08:00
|
|
|
|
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
|
2019-05-14 15:46:18 +08:00
|
|
|
if(@OpenCV_FOUND@)
|
2019-04-17 17:31:09 +08:00
|
|
|
find_dependency(OpenCV)
|
2019-03-14 05:56:44 +08:00
|
|
|
endif()
|
|
|
|
|
2019-03-04 22:15:19 +08:00
|
|
|
if(@ENABLE_CUDA@)
|
2019-07-29 23:17:18 +08:00
|
|
|
include(CheckLanguage)
|
|
|
|
check_language(CUDA)
|
|
|
|
if(NOT CMAKE_CUDA_COMPILER)
|
|
|
|
message(STATUS " --> WARNING: Unable to find native CUDA integration!")
|
|
|
|
endif()
|
2019-05-14 15:46:18 +08:00
|
|
|
if(@CUDNN_FOUND@)
|
2019-04-17 17:31:09 +08:00
|
|
|
find_dependency(CUDNN)
|
2019-04-11 00:20:55 +08:00
|
|
|
endif()
|
2019-03-04 22:15:19 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
|
|
|
find_dependency(Threads)
|
|
|
|
|
2019-07-18 19:14:09 +08:00
|
|
|
if(MSVC)
|
2022-07-01 22:46:41 +08:00
|
|
|
find_dependency(PThreads4W)
|
2019-07-18 19:14:09 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "/wd4018 /wd4244 /wd4267 /wd4305 ${CMAKE_CXX_FLAGS}")
|
2023-09-27 08:04:56 +08:00
|
|
|
if(@unofficial-getopt-win32_FOUND@)
|
|
|
|
find_dependency(unofficial-getopt-win32)
|
|
|
|
endif()
|
2019-03-04 22:15:19 +08:00
|
|
|
endif()
|
|
|
|
|
2019-05-14 15:46:18 +08:00
|
|
|
if(@OPENMP_FOUND@)
|
2019-03-04 22:15:19 +08:00
|
|
|
find_dependency(OpenMP)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Our library dependencies (contains definitions for IMPORTED targets)
|
|
|
|
include("${Darknet_CMAKE_DIR}/DarknetTargets.cmake")
|
2019-07-18 19:14:09 +08:00
|
|
|
include("${Darknet_CMAKE_DIR}/DarknetConfigVersion.cmake")
|
|
|
|
|
2021-01-22 00:36:00 +08:00
|
|
|
if(@OpenCV_FOUND@)
|
2021-01-30 00:08:09 +08:00
|
|
|
set_property(TARGET Darknet::dark APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${OpenCV_INCLUDE_DIRS}")
|
2021-01-22 00:36:00 +08:00
|
|
|
endif()
|
|
|
|
|
2019-07-18 19:14:09 +08:00
|
|
|
get_target_property(FULL_DARKNET_INCLUDE_DIRS Darknet::dark INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
list(GET FULL_DARKNET_INCLUDE_DIRS 0 Darknet_INCLUDE_DIR)
|
|
|
|
get_filename_component(Darknet_INCLUDE_DIR "${Darknet_INCLUDE_DIR}" REALPATH)
|
|
|
|
|
|
|
|
find_package_handle_standard_args(Darknet REQUIRED_VARS Darknet_INCLUDE_DIR VERSION_VAR PACKAGE_VERSION)
|