2018-06-12 16:34:07 +08:00
|
|
|
vcpkg_from_github(
|
2019-02-08 07:22:37 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2018-06-12 16:34:07 +08:00
|
|
|
REPO mongodb/mongo-cxx-driver
|
2022-11-22 01:19:31 +08:00
|
|
|
REF "r${VERSION}"
|
2024-07-02 06:21:56 +08:00
|
|
|
SHA512 a2e303c503b3e79b30c994888a4a9a31178352a1bb4a9ae73a2e41787c113fdd28e3a0e806abbb9e14419fe1b9aea512bcfe3a54edc126b66f0b732f3df09595
|
2019-02-08 07:22:37 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2021-10-27 13:31:19 +08:00
|
|
|
fix-dependencies.patch
|
2016-12-18 16:26:12 +08:00
|
|
|
)
|
2022-11-22 01:19:31 +08:00
|
|
|
file(WRITE "${SOURCE_PATH}/build/VERSION_CURRENT" "${VERSION}")
|
2016-12-18 16:26:12 +08:00
|
|
|
|
2022-11-22 01:19:31 +08:00
|
|
|
# This port offered C++17 ABI alternative via features.
|
|
|
|
# This was reduced to boost only.
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
boost BSONCXX_POLY_USE_BOOST
|
|
|
|
INVERTED_FEATURES
|
|
|
|
boost BSONCXX_POLY_USE_STD
|
|
|
|
boost CMAKE_DISABLE_FIND_PACKAGE_Boost
|
|
|
|
)
|
2019-06-08 20:08:40 +08:00
|
|
|
|
2021-10-27 13:31:19 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-12-11 06:05:01 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2016-12-20 07:16:38 +08:00
|
|
|
OPTIONS
|
2022-11-22 01:19:31 +08:00
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
"-DCMAKE_PROJECT_MONGO_CXX_DRIVER_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
2019-02-08 07:22:37 +08:00
|
|
|
-DBSONCXX_HEADER_INSTALL_DIR=include
|
2022-11-22 01:19:31 +08:00
|
|
|
-DENABLE_TESTS=OFF
|
|
|
|
-DENABLE_UNINSTALL=OFF
|
|
|
|
-DMONGOCXX_HEADER_INSTALL_DIR=include
|
2024-07-02 06:21:56 +08:00
|
|
|
-DNEED_DOWNLOAD_C_DRIVER=OFF
|
2022-11-22 01:19:31 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_Boost
|
2023-11-17 08:52:43 +08:00
|
|
|
BSONCXX_HEADER_INSTALL_DIR
|
|
|
|
MONGOCXX_HEADER_INSTALL_DIR
|
2016-12-18 16:26:12 +08:00
|
|
|
)
|
2021-10-27 13:31:19 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-03-26 11:43:02 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-12-11 06:05:01 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2022-11-22 01:19:31 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "bsoncxx" CONFIG_PATH "lib/cmake/bsoncxx-${VERSION}" DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
2024-03-16 09:14:21 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "mongocxx" CONFIG_PATH "lib/cmake/mongocxx-${VERSION}")
|
2019-06-27 00:44:59 +08:00
|
|
|
|
2019-02-08 07:22:37 +08:00
|
|
|
file(REMOVE_RECURSE
|
2021-10-27 13:31:19 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
2022-11-22 01:19:31 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
2019-02-08 07:22:37 +08:00
|
|
|
)
|
2021-11-05 03:59:01 +08:00
|
|
|
|
2022-11-22 01:19:31 +08:00
|
|
|
function(auto_clean dir)
|
|
|
|
file(GLOB entries "${dir}/*")
|
|
|
|
file(GLOB files LIST_DIRECTORIES false "${dir}/*")
|
|
|
|
foreach(entry IN LISTS entries)
|
|
|
|
if(entry IN_LIST files)
|
|
|
|
continue()
|
|
|
|
endif()
|
|
|
|
file(GLOB_RECURSE children "${entry}/*")
|
|
|
|
if(children)
|
|
|
|
auto_clean("${entry}")
|
|
|
|
else()
|
|
|
|
file(REMOVE_RECURSE "${entry}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
auto_clean("${CURRENT_PACKAGES_DIR}/include")
|
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|