diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index a570ac689d..1b208519e9 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -38,7 +38,7 @@ else() endif() vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DMONGOCXX_HEADER_INSTALL_DIR=include -DBSONCXX_HEADER_INSTALL_DIR=include @@ -62,12 +62,14 @@ set(LIBBSONCXX_VERSION_MINOR ${VERSION_MINOR}) set(LIBBSONCXX_VERSION_PATCH ${VERSION_PATCH}) set(LIBBSONCXX_PACKAGE_VERSION ${VERSION_FULL}) -get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE) - -set(LIBBSONCXX_INCLUDE_DIRS \"\${PACKAGE_PREFIX_DIR}/include\") -find_library(LIBBSONCXX_LIBRARY_PATH_RELEASE bsoncxx bsoncxx-static PATHS \"\${PACKAGE_PREFIX_DIR}/lib\" NO_DEFAULT_PATH) -find_library(LIBBSONCXX_LIBRARY_PATH_DEBUG bsoncxx bsoncxx-static PATHS \"\${PACKAGE_PREFIX_DIR}/debug/lib\" NO_DEFAULT_PATH) -set(LIBBSONCXX_LIBRARIES optimized \${LIBBSONCXX_LIBRARY_PATH_RELEASE} debug \${LIBBSONCXX_LIBRARY_PATH_DEBUG}) +include(CMakeFindDependencyMacro) +find_dependency(bsoncxx CONFIG REQUIRED) +get_filename_component(LIBBSONCXX_INCLUDE_DIRS \"\${CMAKE_CURRENT_LIST_DIR}/../../include\" ABSOLUTE) +if (TARGET mongo::bsoncxx_shared) + set(LIBBSONCXX_LIBRARIES mongo::bsoncxx_shared) +else() + set(LIBBSONCXX_LIBRARIES mongo::bsoncxx_static) +endif() " ) file(WRITE ${CURRENT_PACKAGES_DIR}/share/libmongocxx/libmongocxx-config.cmake @@ -80,48 +82,27 @@ set(LIBMONGOCXX_VERSION_PATCH ${VERSION_PATCH}) set(LIBMONGOCXX_PACKAGE_VERSION ${VERSION_FULL}) include(CMakeFindDependencyMacro) - -find_dependency(libbsoncxx) - -get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE) - -set(LIBMONGOCXX_INCLUDE_DIRS \"\${PACKAGE_PREFIX_DIR}/include\" \${LIBBSONCXX_INCLUDE_DIRS}) -find_library(LIBMONGOCXX_LIBRARY_PATH_RELEASE NAMES mongocxx mongocxx-static PATHS \"\${PACKAGE_PREFIX_DIR}/lib\" NO_DEFAULT_PATH) -find_library(LIBMONGOCXX_LIBRARY_PATH_DEBUG NAMES mongocxx mongocxx-static PATHS \"\${PACKAGE_PREFIX_DIR}/debug/lib\" NO_DEFAULT_PATH) -set(LIBMONGOCXX_LIBRARIES optimized \${LIBMONGOCXX_LIBRARY_PATH_RELEASE} debug \${LIBMONGOCXX_LIBRARY_PATH_DEBUG} \${LIBBSONCXX_LIBRARIES}) +find_dependency(mongocxx CONFIG REQUIRED) +get_filename_component(LIBMONGOCXX_INCLUDE_DIRS \"\${CMAKE_CURRENT_LIST_DIR}/../../include\" ABSOLUTE) +if (TARGET mongo::bsoncxx_shared) + set(LIBMONGOCXX_LIBRARIES mongo::mongocxx_shared) +else() + set(LIBMONGOCXX_LIBRARIES mongo::mongocxx_static) +endif() " ) +vcpkg_fixup_pkgconfig() + if (NOT BSONCXX_POLY STREQUAL MNMLSTC) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party") endif() file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake" - "${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private" - "${CURRENT_PACKAGES_DIR}/include/bsoncxx/private" - "${CURRENT_PACKAGES_DIR}/include/bsoncxx/test" - "${CURRENT_PACKAGES_DIR}/include/bsoncxx/test_util" - - "${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/options/private" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/gridfs/private" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/private" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/test" - "${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util" - "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/bin" - "${CURRENT_PACKAGES_DIR}/debug/lib/cmake" - "${CURRENT_PACKAGES_DIR}/bin" - "${CURRENT_PACKAGES_DIR}/lib/cmake" ) file(REMOVE "${CURRENT_PACKAGES_DIR}/share/${PORT}/uninstall.sh") -vcpkg_fixup_pkgconfig() - file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) file(COPY "${SOURCE_PATH}/THIRD-PARTY-NOTICES" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/mongo-cxx-driver/vcpkg.json b/ports/mongo-cxx-driver/vcpkg.json index 27d8f07beb..6b0216a30f 100644 --- a/ports/mongo-cxx-driver/vcpkg.json +++ b/ports/mongo-cxx-driver/vcpkg.json @@ -1,7 +1,7 @@ { "name": "mongo-cxx-driver", "version": "3.6.5", - "port-version": 1, + "port-version": 2, "description": "MongoDB C++ Driver.", "homepage": "https://github.com/mongodb/mongo-cxx-driver", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 71ef8c5853..a4559f3540 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4458,7 +4458,7 @@ }, "mongo-cxx-driver": { "baseline": "3.6.5", - "port-version": 1 + "port-version": 2 }, "mongoose": { "baseline": "7.1", diff --git a/versions/m-/mongo-cxx-driver.json b/versions/m-/mongo-cxx-driver.json index 696d1d8692..4510acc815 100644 --- a/versions/m-/mongo-cxx-driver.json +++ b/versions/m-/mongo-cxx-driver.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2c9183634ff53b6e76b201ad39abf63b5d26bc8a", + "version": "3.6.5", + "port-version": 2 + }, { "git-tree": "2fd38965003b9bc7a653ab8aaabb8172a043d9d0", "version": "3.6.5",