From 9c48c8e6bda836860686356f1d5793781dd9c04d Mon Sep 17 00:00:00 2001 From: JackLee_CN <809262979@qq.com> Date: Thu, 21 Aug 2025 13:26:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9vcpkg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ CMakeLists.txt | 5 +++-- CMakePresets.json | 4 +++- vcpkg.json | 12 ++++++++++++ vcpkg1.json | 12 ------------ 5 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 vcpkg.json delete mode 100644 vcpkg1.json diff --git a/.gitignore b/.gitignore index eb20748..5acd429 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ dist/ build/ release/ /release +/vcpkg +.gitmodules # Compiled Java class files *.class diff --git a/CMakeLists.txt b/CMakeLists.txt index f50162d..74f8393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,10 @@ #cmake最低版本 cmake_minimum_required(VERSION 3.19) -SET(VCPKG_ROOT "F:/SourceCode/vcpkg") -SET(CMAKE_TOOLCHAIN_FILE "F:/SourceCode/vcpkg/scripts/buildsystems/vcpkg.cmake") +SET(VCPKG_ROOT ${PROJECT_SOURCE_DIR}/vcpkg) +#SET(CMAKE_TOOLCHAIN_FILE "${PROJECT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") SET(VCPKG_TARGET_TRIPLET "x64-mingw-static") +SET(VCPKG_HOST_TRIPLET "x64-mingw-static") SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc.exe") SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++.exe") #项目版本 diff --git a/CMakePresets.json b/CMakePresets.json index 10f80ac..3221e17 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -23,7 +23,9 @@ "CMAKE_MAKE_PROGRAM": "ninja.exe", "CMAKE_C_COMPILER": "x86_64-w64-mingw32-gcc.exe", "CMAKE_CXX_COMPILER": "x86_64-w64-mingw32-g++.exe", - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + "VCPKG_TARGET_TRIPLET":"x64-mingw-static", + "VCPKG_HOST_TRIPLET":"x64-mingw-static", + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" } } ] diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..5d6d756 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,12 @@ +{ + "dependencies": [ + { + "name": "curl", + "version>=": "8.15.0" + }, + { + "name": "libgit2", + "version>=": "1.9.1" + } + ] +} diff --git a/vcpkg1.json b/vcpkg1.json deleted file mode 100644 index 6253309..0000000 --- a/vcpkg1.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": [ - { - "name":"curl", - "version>=":"8.10.1" - }, - { - "name":"libgit2", - "version>=":"1.8.0" - } - ] - } \ No newline at end of file