2016-12-18 16:26:12 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.5.1)
|
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://github.com/mongodb/mongo-c-driver/archive/1.5.1.tar.gz"
|
|
|
|
FILENAME "mongo-c-driver-1.5.1.tar.gz"
|
|
|
|
SHA512 2977e6e1fb3c45256161d2c9bd711fea69b9f8c9ff15362fa636068e0a347c42e10d72fed5649504b552c8212f21cb1ae74d2dc8ca3d1388f49e63b2baf6e16d
|
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
|
2017-01-07 15:21:19 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/bson.patch
|
|
|
|
)
|
|
|
|
|
2016-12-18 16:26:12 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2016-12-20 07:16:38 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR}
|
|
|
|
-DENABLE_TESTS=OFF
|
|
|
|
-DENABLE_EXAMPLES=OFF
|
2016-12-18 16:26:12 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
file(RENAME
|
2016-12-20 07:16:38 +08:00
|
|
|
${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0
|
|
|
|
${CURRENT_PACKAGES_DIR}/temp)
|
2016-12-18 16:26:12 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2016-12-20 07:16:38 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib)
|
|
|
|
|
|
|
|
file(RENAME
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib)
|
|
|
|
file(RENAME
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib)
|
2016-12-18 16:26:12 +08:00
|
|
|
else()
|
2016-12-20 07:16:38 +08:00
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib)
|
2016-12-18 16:26:12 +08:00
|
|
|
endif()
|
|
|
|
|
2016-11-21 13:51:48 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver RENAME copyright)
|