vcpkg/ports/libmariadb/export-cmake-targets.patch
Jack·Boos·Yu 74844c7546
[libmysql/libmariadb] Export unofficial cmake targets (#14290)
* [libmysql/libmariadb] Add vcpkg-cmake-wrapper and usage

* [libmysql] Export target unofficial-libmysql

* [libmariadb] Export target unofficial-libmariadb

* Add conditions

* Remove empty folder

* [libmysql] Enable static build, generate library mysqlclient

* Update ports/libmysql/CONTROL

* [libmysql] Re-write portfile.cmake

* [vcpkg_clean_executables_in_bin] clean up the pdbs

* [libmysql] Fix tools on non-Windows

* [libmysql] Fix tools, fix wrapper

* [libmysql] Add macro libmysql_FOUND

* [vcpkg_clean_executables_in_bin] Revert changes

* [libmysql] Export unofficial-libmysql on both dynamic and static

* Update ports/libmariadb/export-cmake-targets.patch

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2020-11-10 09:28:45 -08:00

27 lines
953 B
Diff

diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt
index 083a863..7bc32b4 100644
--- a/libmariadb/CMakeLists.txt
+++ b/libmariadb/CMakeLists.txt
@@ -460,10 +460,21 @@ INSTALL(TARGETS mariadbclient
LIBRARY DESTINATION lib)
INSTALL(TARGETS libmariadb
COMPONENT SharedLibraries
+ EXPORT unofficial-libmariadb-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
+install(EXPORT unofficial-libmariadb-targets DESTINATION share/unofficial-libmariadb)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-libmariadb-config.cmake"
+[[include(CMakeFindDependencyMacro)
+find_dependency(ZLIB)
+find_dependency(OpenSSL)
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-libmariadb-targets.cmake")
+]])
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-libmariadb-config.cmake DESTINATION share/unofficial-libmariadb)
IF(0)
# On Windows, install PDB