From 43d81795a513e2ca6648354786178714f33c8b6f Mon Sep 17 00:00:00 2001 From: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:04:03 -0700 Subject: [PATCH] [qscintilla] Add CMake export (#37787) --- ports/qscintilla/portfile.cmake | 4 +- .../unofficial-qscintilla-config.cmake | 37 +++++++++++++++++++ ports/qscintilla/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/q-/qscintilla.json | 5 +++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 ports/qscintilla/unofficial-qscintilla-config.cmake diff --git a/ports/qscintilla/portfile.cmake b/ports/qscintilla/portfile.cmake index 34b2d96fd8..3044654ac6 100644 --- a/ports/qscintilla/portfile.cmake +++ b/ports/qscintilla/portfile.cmake @@ -49,5 +49,7 @@ endif() vcpkg_copy_pdbs() +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-qscintilla-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}") + # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/qscintilla/unofficial-qscintilla-config.cmake b/ports/qscintilla/unofficial-qscintilla-config.cmake new file mode 100644 index 0000000000..111ed872d9 --- /dev/null +++ b/ports/qscintilla/unofficial-qscintilla-config.cmake @@ -0,0 +1,37 @@ +if(NOT TARGET unofficial::qscintilla::qscintilla) + include(CMakeFindDependencyMacro) + find_dependency(Qt6Widgets CONFIG) + if(NOT IOS) + find_dependency(Qt6PrintSupport CONFIG) + endif() + + add_library(unofficial::qscintilla::qscintilla UNKNOWN IMPORTED) + get_filename_component(z_vcpkg_qscintilla_root "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component(z_vcpkg_qscintilla_root "${z_vcpkg_qscintilla_root}" PATH) + get_filename_component(z_vcpkg_qscintilla_root "${z_vcpkg_qscintilla_root}" PATH) + + set_target_properties(unofficial::qscintilla::qscintilla PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${z_vcpkg_qscintilla_root}/include" + INTERFACE_LINK_LIBRARIES Qt6::Widgets + ) + + if(NOT IOS) + set_property(TARGET unofficial::qscintilla::qscintilla APPEND PROPERTY INTERFACE_LINK_LIBRARIES Qt6::PrintSupport) + endif() + + find_library(Z_VCPKG_QSCINTILLA_LIBRARY_RELEASE NAMES libqscintilla2_qt6 qscintilla2_qt6 PATHS "${z_vcpkg_qscintilla_root}/lib" NO_DEFAULT_PATH) + if(EXISTS "${Z_VCPKG_QSCINTILLA_LIBRARY_RELEASE}") + set_property(TARGET unofficial::qscintilla::qscintilla APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release") + set_target_properties(unofficial::qscintilla::qscintilla PROPERTIES + IMPORTED_LOCATION_RELEASE "${Z_VCPKG_QSCINTILLA_LIBRARY_RELEASE}") + endif() + + find_library(Z_VCPKG_QSCINTILLA_LIBRARY_DEBUG NAMES libqscintilla2_qt6 qscintilla2_qt6d libqscintilla2_qt6_debug PATHS "${z_vcpkg_qscintilla_root}/debug/lib" NO_DEFAULT_PATH) + if(EXISTS "${Z_VCPKG_QSCINTILLA_LIBRARY_DEBUG}") + set_property(TARGET unofficial::qscintilla::qscintilla APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug") + set_target_properties(unofficial::qscintilla::qscintilla PROPERTIES + IMPORTED_LOCATION_DEBUG "${Z_VCPKG_QSCINTILLA_LIBRARY_DEBUG}") + endif() + + unset(z_vcpkg_qscintilla_root) +endif() diff --git a/ports/qscintilla/vcpkg.json b/ports/qscintilla/vcpkg.json index c83d25cddf..37db8849dc 100644 --- a/ports/qscintilla/vcpkg.json +++ b/ports/qscintilla/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qscintilla", "version": "2.14.1", + "port-version": 1, "description": "QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin)", "homepage": "https://www.riverbankcomputing.com/software/qscintilla", "license": "GPL-3.0-or-later", diff --git a/versions/baseline.json b/versions/baseline.json index 1473ea4141..a68c8fc7fe 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7086,7 +7086,7 @@ }, "qscintilla": { "baseline": "2.14.1", - "port-version": 0 + "port-version": 1 }, "qt": { "baseline": "6.6.1", diff --git a/versions/q-/qscintilla.json b/versions/q-/qscintilla.json index 866e5c82c1..3c09a002c6 100644 --- a/versions/q-/qscintilla.json +++ b/versions/q-/qscintilla.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "dc5fd8d8484f29c7fd10d360f74d6b1bff6bd884", + "version": "2.14.1", + "port-version": 1 + }, { "git-tree": "3280645a840ece797868b44065cbbe3b609b4099", "version": "2.14.1",