diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a5592509..45cbda33d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,8 @@ if (NOT VCPKG_OVERLAY_PORTS) endif() endif() +list(APPEND VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_SOURCE_DIR}/extern/vcpkg/ports") + message(STATUS "VCPKG_OVERLAY_PORTS ${VCPKG_OVERLAY_PORTS}") if (NOT VCPKG_OVERLAY_TRIPLETS) diff --git a/extern/vcpkg/ports/ada-url/no-cpm.patch b/extern/vcpkg/ports/ada-url/no-cpm.patch new file mode 100644 index 000000000..fc235aa8d --- /dev/null +++ b/extern/vcpkg/ports/ada-url/no-cpm.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b206edb6..1db4099d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,7 +30,6 @@ option(ADA_TESTING "Build tests" ${BUILD_TESTING}) + # errors due to CPM, so this is here to support disabling all the testing + # and tooling for ada if one only wishes to use the ada library. + if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) +- include(cmake/CPM.cmake) + # CPM requires git as an implicit dependency + find_package(Git QUIET) + # We use googletest in the tests +diff --git a/tools/cli/CMakeLists.txt b/tools/cli/CMakeLists.txt +index ff57220b..a6d90f29 100644 +--- a/tools/cli/CMakeLists.txt ++++ b/tools/cli/CMakeLists.txt +@@ -8,12 +8,8 @@ if(MSVC AND BUILD_SHARED_LIBS) + "$" # <--this is in-file + "$") # <--this is out-file path + endif() +-CPMAddPackage("gh:fmtlib/fmt#10.2.1") +-CPMAddPackage( +- GITHUB_REPOSITORY jarro2783/cxxopts +- VERSION 3.2.0 +- OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES" +-) ++find_package(fmt CONFIG REQUIRED) ++find_package(cxxopts CONFIG REQUIRED) + target_link_libraries(adaparse PRIVATE cxxopts::cxxopts fmt::fmt) + + if(MSVC OR MINGW) diff --git a/extern/vcpkg/ports/ada-url/portfile.cmake b/extern/vcpkg/ports/ada-url/portfile.cmake new file mode 100644 index 000000000..367bd15c8 --- /dev/null +++ b/extern/vcpkg/ports/ada-url/portfile.cmake @@ -0,0 +1,40 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ada-url/ada + REF "920a8b34c194a4f3930c20b62afaee45f071ea37" + SHA512 6e7d06cc9550fbe08984e835f7bbda4a322023e087425cf4e90a19ef019cedbe55df70cc6f61c21b771c7dae7ee1f56d3fcde3371206bac1adbe83dffa7cf032 + HEAD_REF main + PATCHES + #no-cpm.patch +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools ADA_TOOLS +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DADA_BENCHMARKS=OFF + -DBUILD_TESTING=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DADA_TOOLS=OFF +) + +vcpkg_cmake_install() + +vcpkg_copy_pdbs() + +vcpkg_cmake_config_fixup(PACKAGE_NAME ada CONFIG_PATH "lib/cmake/ada") + +if("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES adaparse AUTO_CLEAN) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE-APACHE" "${SOURCE_PATH}/LICENSE-MIT") diff --git a/extern/vcpkg/ports/ada-url/vcpkg.json b/extern/vcpkg/ports/ada-url/vcpkg.json new file mode 100644 index 000000000..c812d8997 --- /dev/null +++ b/extern/vcpkg/ports/ada-url/vcpkg.json @@ -0,0 +1,27 @@ +{ + "name": "ada-url", + "version": "2.9.2-plus", + "description": "WHATWG-compliant and fast URL parser written in modern C++", + "homepage": "https://ada-url.com/", + "license": "MIT", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "tools": { + "description": "Build CLI tools (adaparse)", + "supports": "!uwp", + "dependencies": [ + "cxxopts", + "fmt" + ] + } + } +}