#
# This is a CMake makefile. You can find the cmake utility and
# information about it at http://www.cmake.org
#
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
project(dlib)
set(CPACK_PACKAGE_NAME "dlib")
set(CPACK_PACKAGE_VERSION_MAJOR "19")
set(CPACK_PACKAGE_VERSION_MINOR "24")
set(CPACK_PACKAGE_VERSION_PATCH "99")
set(VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
# Only print these messages once, even if dlib is added multiple times via add_subdirectory()
if (NOT TARGET dlib)
message(STATUS "Using CMake version: ${CMAKE_VERSION}")
message(STATUS "Compiling dlib version: ${VERSION}")
endif()
include(cmake_utils/set_compiler_specific_options.cmake)
# Adhere to GNU filesystem layout conventions
include(GNUInstallDirs)
if (POLICY CMP0063)
# This policy tells cmake to really honor CXX_VISIBILITY_PRESET rather than
# ignore it for backwards compatibility.
cmake_policy(SET CMP0063 NEW)
endif()
if (POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
# default to a Release build (except if CMAKE_BUILD_TYPE is set)
include(cmake_utils/release_build_by_default)
include(cmake_utils/use_cpp_11.cmake)
# Set DLIB_VERSION in the including CMake file so they can use it to do whatever they want.
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DLIB_VERSION ${VERSION} PARENT_SCOPE)
if (NOT DEFINED DLIB_IN_PROJECT_BUILD)
set(DLIB_IN_PROJECT_BUILD true)
endif()
endif()
if (COMMAND pybind11_add_module AND MSVC)
# True when building a python extension module using Visual Studio. We care
# about this because a huge number of windows users have broken systems, and
# in particular, they have broken or incompatibly installed copies of things
# like libjpeg or libpng. So if we detect we are in this mode we will never
# ever link to those libraries. Instead, we link to the copy included with
# dlib.
set (BUILDING_PYTHON_IN_MSVC true)
else()
set (BUILDING_PYTHON_IN_MSVC false)
endif()
if (DLIB_IN_PROJECT_BUILD)
# Check if we are being built as part of a pybind11 module.
if (COMMAND pybind11_add_module)
set(CMAKE_POSITION_INDEPENDENT_CODE True)
if (CMAKE_COMPILER_IS_GNUCXX)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
# -fPIC for GCC but sometimes it still doesn't get set, so make sure it
# does.
add_definitions("-fPIC")
endif()
# Make DLIB_ASSERT statements not abort the python interpreter, but just return an error.
list(APPEND active_preprocessor_switches "-DDLIB_NO_ABORT_ON_2ND_FATAL_ERROR")
endif()
# DLIB_IN_PROJECT_BUILD==true means you are using dlib by invoking
# add_subdirectory(dlib) in the parent project. In this case, we always want
# to build dlib as a static library so the parent project doesn't need to
# deal with some random dlib shared library file. It is much better to
# statically compile dlib into the parent project. So the following bit of
# CMake ensures that happens. However, we have to take care to compile dlib
# with position independent code if appropriate (i.e. if the parent project
# is a shared library).
if (BUILD_SHARED_LIBS)
if (CMAKE_COMPILER_IS_GNUCXX)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
# -fPIC for GCC but sometimes it still doesn't get set, so make sure it
# does.
add_definitions("-fPIC")
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE true)
endif()
# Tell cmake to build dlib as a static library
set(BUILD_SHARED_LIBS false)
elseif(BUILD_SHARED_LIBS)
if (MSVC)
message(FATAL_ERROR "Building dlib as a standalone dll is not supported when using Visual Studio. You are highly encouraged to use static linking instead. See https://github.com/davisking/dlib/issues/1483 for a discussion.")
endif()
endif()
if (CMAKE_VERSION VERSION_LESS "3.9.0")
# Set only because there are old target_link_libraries() statements in the
# FindCUDA.cmake file that comes with CMake that error out if the new behavior
# is used. In newer versions of CMake we can instead set CUDA_LINK_LIBRARIES_KEYWORD which fixes this issue.
cmake_policy(SET CMP0023 OLD)
else()
set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC)
endif()
macro (enable_preprocessor_switch option_name)
list(APPEND active_preprocessor_switches "-D${option_name}")
endmacro()
macro (disable_preprocessor_switch option_name)
if (active_preprocessor_switches)
list(REMOVE_ITEM active_preprocessor_switches "-D${option_name}")
endif()
endmacro()
macro (toggle_preprocessor_switch option_name)
if (${option_name})
enable_preprocessor_switch(${option_name})
else()
disable_preprocessor_switch(${option_name})
endif()
endmacro()
# Suppress superfluous randlib warnings about libdlib.a having no symbols on MacOSX.
if (APPLE)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
# Don't try to call add_library(dlib) and setup dlib's stuff if it has already
# been done by some other part of the current cmake project. We do this
# because it avoids getting warnings/errors about cmake policy CMP0002. This
# happens when a project tries to call add_subdirectory() on dlib more than
# once. This most often happens when the top level of a project depends on two
# or more other things which both depend on dlib.
if (NOT TARGET dlib)
set (DLIB_ISO_CPP_ONLY_STR
"Enable this if you don't want to compile any non-ISO C++ code (i.e. you don't use any of the API Wrappers)" )
set (DLIB_NO_GUI_SUPPORT_STR
"Enable this if you don't want to compile any of the dlib GUI code" )
set (DLIB_ENABLE_STACK_TRACE_STR
"Enable this if you want to turn on the DLIB_STACK_TRACE macros" )
set (DLIB_USE_BLAS_STR
"Disable this if you don't want to use a BLAS library" )
set (DLIB_USE_LAPACK_STR
"Disable this if you don't want to use a LAPACK library" )
set (DLIB_USE_CUDA_STR
"Disable this if you don't want to use NVIDIA CUDA" )
set (DLIB_USE_CUDA_COMPUTE_CAPABILITIES_STR
"Set this to a comma-separated list of CUDA compute capabilities" )
set (DLIB_USE_MKL_SEQUENTIAL_STR
"Enable this if you have MKL installed and want to use the sequential version instead of the multi-core version." )
set (DLIB_USE_MKL_WITH_TBB_STR
"Enable this if you have MKL installed and want to use the tbb version instead of the openmp version." )
set (DLIB_PNG_SUPPORT_STR
"Disable this if you don't want to link against libpng" )
set (DLIB_GIF_SUPPORT_STR
"Disable this if you don't want to link against libgif" )
set (DLIB_JPEG_SUPPORT_STR
"Disable this if you don't want to link against libjpeg" )
set (DLIB_WEBP_SUPPORT_STR
"Disable this if you don't want to link against libwebp" )
set (DLIB_LINK_WITH_SQLITE3_STR
"Disable this if you don't want to link against sqlite3" )
#set (DLIB_USE_FFTW_STR "Disable this if you don't want to link against fftw" )
set (DLIB_USE_MKL_FFT_STR
"Disable this is you don't want to use the MKL DFTI FFT implementation" )
set (DLIB_ENABLE_ASSERTS_STR
"Enable this if you want to turn on the DLIB_ASSERT macro" )
option(DLIB_ENABLE_ASSERTS ${DLIB_ENABLE_ASSERTS_STR} OFF)
option(DLIB_ISO_CPP_ONLY ${DLIB_ISO_CPP_ONLY_STR} OFF)
toggle_preprocessor_switch(DLIB_ISO_CPP_ONLY)
option(DLIB_NO_GUI_SUP
没有合适的资源?快使用搜索试试~ 我知道了~
Dlib 是一個現代 C++ 跨平台開工具包 機器學習算法 數值算法 圖像處理 含低階和高階視覺面人臉檢測和物體姿態估計等算法
共1585个文件
h:1008个
c:240个
cpp:234个
需积分: 10 0 下载量 65 浏览量
2022-07-29
12:09:55
上传
评论
收藏 2.48MB 7Z 举报
温馨提示
Dlib 是一個現代 C++ 工具包,包含用於在 C++ 中創建複雜軟件以解決現實世界問題的機器學習算法和工具。它被廣泛應用於工業和學術界,包括機器人、嵌入式設備、移動電話和大型高性能計算環境。Dlib 的開源許可 允許您在任何應用程序中免費使用它。 特色封裝下列算法 機器學習算法 數值算法 圖像處理 例如邊緣查找和形態學操作和SURF、 HOG和FHOG 特徵提取算法的實現 也包括 高品質人臉識別 與正面人臉檢測和 物體姿態估計。
资源详情
资源评论
资源推荐
收起资源包目录
Dlib 是一個現代 C++ 跨平台開工具包 機器學習算法 數值算法 圖像處理 含低階和高階視覺面人臉檢測和物體姿態估計等算法 (1585个子文件)
WINDOWS_build_and_run_all_unit_tests.bat 851B
jidctint.c 180KB
pngrtran.c 164KB
jfdctint.c 155KB
png.c 154KB
pngrutil.c 144KB
pngread.c 139KB
transupp.c 86KB
pngwutil.c 78KB
deflate.c 77KB
pngwrite.c 75KB
inflate.c 54KB
pngset.c 50KB
jchuff.c 49KB
jdhuff.c 48KB
jquant2.c 47KB
jdmarker.c 45KB
trees.c 43KB
jmemmgr.c 40KB
pngget.c 33KB
pngpread.c 31KB
jquant1.c 31KB
pngerror.c 28KB
jcarith.c 28KB
pngtrans.c 25KB
jdcoefct.c 25KB
jdcolor.c 24KB
jdinput.c 24KB
jdarith.c 24KB
jcmaster.c 22KB
rdgif.c 22KB
infback.c 22KB
jpegtran.c 21KB
jdmainct.c 20KB
gzread.c 20KB
jcparam.c 20KB
jcsample.c 19KB
jccolor.c 19KB
gzwrite.c 19KB
jdmaster.c 19KB
jcmarker.c 18KB
wrgif.c 18KB
wrjpgcom.c 17KB
gzlib.c 16KB
jccoefct.c 16KB
rdppm.c 15KB
jdmerge.c 15KB
pngwtran.c 15KB
jcdctmgr.c 15KB
rdtarga.c 15KB
rdbmp.c 15KB
rdjpgcom.c 14KB
jctrans.c 14KB
crc32.c 14KB
wrbmp.c 13KB
jdapimin.c 13KB
inftrees.c 13KB
inffast.c 13KB
jidctfst.c 12KB
jddctmgr.c 12KB
jcprepct.c 12KB
jdsample.c 11KB
rdrle.c 11KB
filter_neon_intrinsics.c 11KB
rdswitch.c 11KB
jcinit.c 10KB
jdpostct.c 9KB
jcmainct.c 9KB
jdapistd.c 9KB
jcapimin.c 9KB
jdatasrc.c 9KB
wrrle.c 9KB
jdatadst.c 8KB
jidctflt.c 8KB
pngmem.c 8KB
jmemname.c 8KB
wrppm.c 8KB
jcomapi.c 8KB
jfdctfst.c 8KB
jerror.c 8KB
wrtarga.c 7KB
zutil.c 7KB
arm_init.c 7KB
rdcolmap.c 7KB
jutils.c 7KB
jfdctflt.c 6KB
jcapistd.c 6KB
pngwio.c 5KB
adler32.c 5KB
jaricom.c 5KB
jdtrans.c 5KB
jmemansi.c 5KB
palette_neon_intrinsics.c 5KB
cblas_zgbmv.c 4KB
cblas_cgbmv.c 4KB
pngrio.c 4KB
cblas_cgemv.c 4KB
cblas_zgemv.c 4KB
cblas_ztbsv.c 3KB
cblas_ctbsv.c 3KB
共 1585 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
qoog8m
- 粉丝: 2
- 资源: 85
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0