代码拉取完成,页面将自动刷新
同步操作将从 奥比中光科技集团股份有限公司/OrbbecSDK 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
cmake_minimum_required(VERSION 3.1.15)
project(OrbbecSDK VERSION 1.10.8 LANGUAGES C CXX)
# Determine host platform
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DetermineHostPlatform.cmake)
if(WIN32)
set(ORBBEC_LIB_PREFIX "")
set(ORBBEC_LIB_SUFFIX ".lib")
set(ORBBEC_DLL_SUFFIX ".dll")
elseif(APPLE)
set(ORBBEC_LIB_PREFIX "lib")
set(ORBBEC_LIB_SUFFIX ".dylib")
set(ORBBEC_DLL_SUFFIX ".dylib")
elseif(UNIX)
set(ORBBEC_LIB_PREFIX "lib")
set(ORBBEC_LIB_SUFFIX ".so")
set(ORBBEC_DLL_SUFFIX ".so")
endif()
# OrbbecSDK library
set(OrbbecSDK_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/${HOST_PLATFORM})
set(OrbbecSDK_LIBRARY ${OrbbecSDK_LIBS_DIR}/${ORBBEC_LIB_PREFIX}OrbbecSDK${ORBBEC_LIB_SUFFIX})
set(OrbbecSDK_DLL ${OrbbecSDK_LIBS_DIR}/${ORBBEC_LIB_PREFIX}OrbbecSDK${ORBBEC_DLL_SUFFIX})
set(OrbbecSDK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include/)
set(OrbbecSDK_LIBS ${OrbbecSDK_LIBRARY})
set(OrbbecSDK_FOUND TRUE)
add_library(OrbbecSDK::OrbbecSDK SHARED IMPORTED GLOBAL)
set_target_properties(OrbbecSDK::OrbbecSDK PROPERTIES
IMPORTED_LOCATION ${OrbbecSDK_DLL}
IMPORTED_IMPLIB ${OrbbecSDK_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${OrbbecSDK_INCLUDE_DIRS}
)
# check if the project is being used directly or via add_subdirectory
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) # project is used directly
# Set the C++ standard to C++ 11 and C standard to C11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
# Options
option(BUILD_EXAMPLES "Build examples" ON)
option(INSTALL_LIBUDEV "Install libudev" OFF)
# Compiler and Linker options
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O3")
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif ()
# paths
set(ORBBEC_EXAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/examples/)
set(ORBBEC_DOCS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc/)
set(ORBBEC_MISC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/misc/)
set(ORBBEC_CONFIG_DIR ${ORBBEC_MISC_DIR}/config/)
set(ORBBEC_SCRIPT_DIR ${ORBBEC_MISC_DIR}/scripts/)
# Subdirectories
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif ()
# Installation of headers, configs, libs
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/InstallTargets.cmake)
# Package configuration
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/OrbbecSDKConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/OrbbecSDKConfig.cmake"
INSTALL_DESTINATION lib/
PATH_VARS OrbbecSDK_INCLUDE_DIRS OrbbecSDK_LIBS_DIR
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/OrbbecSDKConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/OrbbecSDKConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/OrbbecSDKConfigVersion.cmake"
DESTINATION lib/
)
# OrbbecSDK.pc.in
if((UNIX))
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/OrbbecSDK.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/OrbbecSDK.pc"
@ONLY
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/OrbbecSDK.pc"
DESTINATION lib/pkgconfig/
)
endif()
# Uninstall target
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/UninstallTarget.cmake)
endif()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。