2019-10-07 19:35:13 +02:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mongodb/mongo-c-driver
|
2022-11-02 22:39:31 +01:00
|
|
|
REF "${VERSION}"
|
2025-01-08 07:42:58 -08:00
|
|
|
SHA512 8624966472603d5a20b2b01488660897b3ba9910fb69a41996852836bd5d4eb7e2c7fcfba3bdfcb01715ed83d08c7f9e93f98b59d1fe88f67f1a5a7de9b0a42e
|
2019-10-07 19:35:13 +02:00
|
|
|
HEAD_REF master
|
2020-05-02 03:43:06 +08:00
|
|
|
PATCHES
|
2022-11-02 22:39:31 +01:00
|
|
|
fix-include-directory.patch # vcpkg legacy decision
|
2019-10-07 19:35:13 +02:00
|
|
|
)
|
2022-11-02 22:39:31 +01:00
|
|
|
file(WRITE "${SOURCE_PATH}/VERSION_CURRENT" "${VERSION}")
|
2019-10-07 19:35:13 +02:00
|
|
|
|
2022-11-02 22:39:31 +01:00
|
|
|
# Cannot use string(COMPARE EQUAL ...)
|
|
|
|
set(ENABLE_STATIC OFF)
|
2023-11-17 08:52:43 +08:00
|
|
|
set(ENABLE_SHARED OFF)
|
2021-10-27 06:31:19 +01:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
set(ENABLE_STATIC ON)
|
2023-11-17 08:52:43 +08:00
|
|
|
else()
|
|
|
|
set(ENABLE_SHARED ON)
|
2021-10-27 06:31:19 +01:00
|
|
|
endif()
|
2019-11-19 11:14:40 -08:00
|
|
|
|
2021-09-08 11:56:06 -07:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-12-12 10:20:57 +01:00
|
|
|
DISABLE_PARALLEL_CONFIGURE # because it writes the file VERSION_CURRENT in the source directory
|
2019-10-07 19:35:13 +02:00
|
|
|
OPTIONS
|
2023-11-29 00:52:25 -08:00
|
|
|
"-DBUILD_VERSION=${VERSION}"
|
2019-10-07 19:35:13 +02:00
|
|
|
-DENABLE_BSON=ON
|
|
|
|
-DENABLE_EXAMPLES=OFF
|
2022-11-02 22:39:31 +01:00
|
|
|
-DENABLE_ICU=OFF
|
|
|
|
-DENABLE_MONGOC=OFF
|
|
|
|
-DENABLE_SASL=OFF
|
|
|
|
-DENABLE_SNAPPY=OFF
|
|
|
|
-DENABLE_SRV=OFF
|
|
|
|
-DENABLE_SSL=OFF
|
2019-10-07 19:35:13 +02:00
|
|
|
-DENABLE_STATIC=${ENABLE_STATIC}
|
2023-11-17 08:52:43 +08:00
|
|
|
-DENABLE_SHARED=${ENABLE_SHARED}
|
2022-11-02 22:39:31 +01:00
|
|
|
-DENABLE_TESTS=OFF
|
|
|
|
-DENABLE_UNINSTALL=OFF
|
|
|
|
-DENABLE_ZLIB=SYSTEM
|
|
|
|
-DENABLE_ZSTD=OFF
|
2023-12-12 10:20:57 +01:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Python=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON
|
2023-11-17 08:52:43 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
ENABLE_ICU
|
2019-10-07 19:35:13 +02:00
|
|
|
)
|
2021-09-08 11:56:06 -07:00
|
|
|
vcpkg_cmake_install()
|
2020-05-02 03:43:06 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2022-11-02 22:39:31 +01:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-10-27 06:31:19 +01:00
|
|
|
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME bson-1.0 CONFIG_PATH "lib/cmake/bson-1.0" DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
2022-11-02 22:39:31 +01:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/bson/bson-macros.h"
|
|
|
|
"#define BSON_MACROS_H" "#define BSON_MACROS_H\n#ifndef BSON_STATIC\n#define BSON_STATIC\n#endif")
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME libbson-static-1.0 CONFIG_PATH "lib/cmake/libbson-static-1.0")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/libbson-1.0")
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/libbson-1.0-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libbson-1.0")
|
2019-10-07 19:35:13 +02:00
|
|
|
else()
|
2021-10-27 06:31:19 +01:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME libbson-1.0 CONFIG_PATH "lib/cmake/libbson-1.0")
|
2019-10-07 19:35:13 +02:00
|
|
|
endif()
|
2020-12-07 18:17:19 -08:00
|
|
|
|
2022-11-02 22:39:31 +01:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/mongo-c-driver"
|
|
|
|
)
|
2020-05-02 03:43:06 +08:00
|
|
|
|
2022-11-02 22:39:31 +01:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2021-10-28 00:19:28 +02:00
|
|
|
|
2022-11-02 22:39:31 +01:00
|
|
|
vcpkg_install_copyright(
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/COPYING"
|
|
|
|
"${SOURCE_PATH}/THIRD_PARTY_NOTICES"
|
|
|
|
"${SOURCE_PATH}/src/libbson/THIRD_PARTY_NOTICES"
|
|
|
|
)
|