2017-11-07 15:59:02 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO IntelRealSense/librealsense
|
2018-04-24 22:04:09 +08:00
|
|
|
REF v2.10.4
|
|
|
|
SHA512 35580cd4ab65b85eb7fcebac3be629960993223437e3c44b0bcc2f7572d85231e822a922b2f5e22480fcc1edb9295ab2c5893794d638c2ab6faf49a9eea57603
|
2018-03-08 03:01:49 +08:00
|
|
|
HEAD_REF development
|
2017-11-07 15:59:02 +08:00
|
|
|
)
|
|
|
|
|
2018-04-18 01:01:22 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_LIBRARY_LINKAGE)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_CRT_LINKAGE)
|
|
|
|
|
|
|
|
set(BUILD_EXAMPLES OFF)
|
|
|
|
set(BUILD_GRAPHICAL_EXAMPLES OFF)
|
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
set(BUILD_EXAMPLES ON)
|
|
|
|
set(BUILD_GRAPHICAL_EXAMPLES ON)
|
|
|
|
endif()
|
2017-11-07 15:59:02 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
2018-04-24 22:04:09 +08:00
|
|
|
#Ungrouped Entries
|
2017-12-24 22:46:16 +08:00
|
|
|
-DENFORCE_METADATA=ON
|
2018-04-24 22:04:09 +08:00
|
|
|
# BUILD
|
2018-04-18 01:01:22 +08:00
|
|
|
-DBUILD_EXAMPLES=${BUILD_EXAMPLES}
|
|
|
|
-DBUILD_GRAPHICAL_EXAMPLES=${BUILD_GRAPHICAL_EXAMPLES}
|
2018-04-24 22:04:09 +08:00
|
|
|
-DBUILD_SHARED_LIBS=${BUILD_LIBRARY_LINKAGE}
|
2017-12-24 22:46:16 +08:00
|
|
|
-DBUILD_UNIT_TESTS=OFF
|
2018-03-08 03:01:49 +08:00
|
|
|
-DBUILD_WITH_OPENMP=OFF
|
|
|
|
-DBUILD_WITH_STATIC_CRT=${BUILD_CRT_LINKAGE}
|
2017-11-07 15:59:02 +08:00
|
|
|
OPTIONS_DEBUG
|
2018-04-24 22:07:37 +08:00
|
|
|
# BUILD
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_GRAPHICAL_EXAMPLES=OFF
|
2018-04-24 22:04:09 +08:00
|
|
|
# CMAKE
|
2017-11-07 15:59:02 +08:00
|
|
|
"-DCMAKE_PDB_OUTPUT_DIRECTORY=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
|
2018-03-08 03:01:49 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX="_d"
|
2017-11-07 15:59:02 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/realsense2)
|
2018-04-18 01:01:22 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-11-07 15:59:02 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2018-04-18 01:01:22 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2017-11-07 15:59:02 +08:00
|
|
|
|
2018-04-24 22:07:37 +08:00
|
|
|
if(BUILD_EXAMPLES)
|
2018-04-18 01:01:22 +08:00
|
|
|
file(GLOB EXEFILES_RELEASE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
|
|
|
file(GLOB EXEFILES_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
|
|
|
file(COPY ${EXEFILES_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/realsense2)
|
|
|
|
file(REMOVE ${EXEFILES_RELEASE} ${EXEFILES_DEBUG})
|
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/realsense2)
|
|
|
|
endif()
|
2017-11-07 15:59:02 +08:00
|
|
|
|
2018-04-18 01:01:22 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/realsense2)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/realsense2/COPYING ${CURRENT_PACKAGES_DIR}/share/realsense2/copyright)
|