[libmysql] Fix could not find package config files (#22062)

* [libmysql] Fix could not find package config files

* update version

* [poco] Fix install PocoDataMySQL.lib

* update version

* [poco] Update portfile.cmake

* update version

Co-authored-by: Lily Wang <v-lilywang@microsoft.com>
This commit is contained in:
LilyWangLL 2021-12-23 11:53:44 +08:00 committed by GitHub
parent cfcd2fe2da
commit 055684d93a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 19 deletions

View File

@ -1,5 +1,3 @@
vcpkg_fail_port_install(ON_TARGET "UWP" ON_ARCH "x86")
if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h")
message(FATAL_ERROR "FATAL ERROR: ${PORT} and libmariadb are incompatible.")
endif()
@ -101,14 +99,14 @@ endif()
vcpkg_copy_tools(TOOL_NAMES ${MYSQL_TOOLS} AUTO_CLEAN)
file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/libmysql")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/libmysql")
file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/${PORT}")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/share")
file(RENAME "${CURRENT_PACKAGES_DIR}/libmysql" "${CURRENT_PACKAGES_DIR}/share/libmysql")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/libmysql" "${CURRENT_PACKAGES_DIR}/debug/share/libmysql")
file(RENAME "${CURRENT_PACKAGES_DIR}/${PORT}" "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/${PORT}" "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}")
vcpkg_cmake_config_fixup(CONFIG_PATH share/libmysql/unofficial-libmysql)
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libmysql CONFIG_PATH share/${PORT}/unofficial-libmysql)
# switch mysql into /mysql
file(RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/include2")

View File

@ -1,7 +1,7 @@
{
"name": "libmysql",
"version": "8.0.20",
"port-version": 4,
"port-version": 5,
"description": "A MySQL client library for C development",
"homepage": "https://github.com/mysql/mysql-server",
"supports": "!(windows & x86) & !uwp",

View File

@ -0,0 +1,13 @@
diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt
index 9d0a85c..4f1ae21 100644
--- a/Data/CMakeLists.txt
+++ b/Data/CMakeLists.txt
@@ -45,7 +45,7 @@ else(ENABLE_DATA_SQLITE)
message(STATUS "SQLite Support Disabled")
endif()
-if((MYSQL_FOUND OR unofficial-libmariadb_FOUND) AND ENABLE_DATA_MYSQL)
+if((unofficial-libmysql_FOUND OR unofficial-libmariadb_FOUND) AND ENABLE_DATA_MYSQL)
message(STATUS "MySQL Support Enabled")
add_subdirectory(MySQL)
else()

View File

@ -1,5 +1,3 @@
vcpkg_fail_port_install(ON_TARGET "UWP")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pocoproject/poco
@ -14,6 +12,7 @@ vcpkg_from_github(
fix_dependency.patch
fix-feature-sqlite3.patch
fix-error-c3861.patch
fix-InstallDataMysql.patch
)
file(REMOVE "${SOURCE_PATH}/Foundation/src/pcre.h")
@ -84,20 +83,20 @@ vcpkg_copy_tools(TOOL_NAMES cpspc f2cpsp PocoDoc tec arc AUTO_CLEAN)
# Copy additional include files not part of any libraries
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL")
file(COPY ${SOURCE_PATH}/Data/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(COPY "${SOURCE_PATH}/Data/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/MySQL")
file(COPY ${SOURCE_PATH}/Data/MySQL/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(COPY "${SOURCE_PATH}/Data/MySQL/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/ODBC")
file(COPY ${SOURCE_PATH}/Data/ODBC/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(COPY "${SOURCE_PATH}/Data/ODBC/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/PostgreSQL")
file(COPY ${SOURCE_PATH}/Data/PostgreSQL/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/libpq)
file(COPY "${SOURCE_PATH}/Data/PostgreSQL/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/libpq")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/include/Poco/SQL/SQLite")
file(COPY ${SOURCE_PATH}/Data/SQLite/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(COPY "${SOURCE_PATH}/Data/SQLite/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
endif()
if(VCPKG_TARGET_IS_WINDOWS)

View File

@ -1,7 +1,7 @@
{
"name": "poco",
"version-semver": "1.11.0",
"port-version": 1,
"port-version": 2,
"description": "Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems.",
"homepage": "https://github.com/pocoproject/poco",
"supports": "!uwp",

View File

@ -3706,7 +3706,7 @@
},
"libmysql": {
"baseline": "8.0.20",
"port-version": 4
"port-version": 5
},
"libnice": {
"baseline": "0.1.15",
@ -5338,7 +5338,7 @@
},
"poco": {
"baseline": "1.11.0",
"port-version": 1
"port-version": 2
},
"podofo": {
"baseline": "0.9.7",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d19f8e799e7eb9dc6c24968d1fa8c31debc38b62",
"version": "8.0.20",
"port-version": 5
},
{
"git-tree": "5279f421e4d9409a5d78b0f767d41374f2f7e168",
"version": "8.0.20",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6dec8737e7e8e89f212ae2ab75c55c6e977d8ab8",
"version-semver": "1.11.0",
"port-version": 2
},
{
"git-tree": "83279266114bf6eab34a86e6009313e10f3aa11e",
"version-semver": "1.11.0",