* update port version.

* done.

* Fix port build.

* update version.

* resolve some comments.

* fix versions.

* add cmake config file.

* update versions file.

* use unofficial namespace.

* fix debug-only and release-only builds.

* update versions file.

* update versions.
This commit is contained in:
Nick D'Ademo 2023-11-17 08:49:36 +08:00 коммит произвёл GitHub
Родитель b4f39984b9
Коммит 42f810ba26
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 43 добавлений и 40 удалений

Просмотреть файл

@ -1,25 +0,0 @@
cmake_minimum_required(VERSION 3.11)
project(wintoast)
set(SRC_FILES
src/wintoastlib.cpp
)
add_library(wintoast ${SRC_FILES})
target_include_directories(wintoast PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include/wintoast>
)
# Install targets
install(TARGETS wintoast
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
# Install headers
if (INSTALL_HEADERS)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/wintoastlib.h DESTINATION include/wintoast)
endif()

Просмотреть файл

@ -0,0 +1,19 @@
if(NOT TARGET unofficial::wintoast::wintoast)
add_library(unofficial::wintoast::wintoast UNKNOWN IMPORTED)
set_target_properties(unofficial::wintoast::wintoast PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include"
)
find_library(WinToast_LIBRARY_RELEASE NAMES WinToast PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
if(EXISTS "${WinToast_LIBRARY_RELEASE}")
set_property(TARGET unofficial::wintoast::wintoast APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release")
set_target_properties(unofficial::wintoast::wintoast PROPERTIES IMPORTED_LOCATION_RELEASE "${WinToast_LIBRARY_RELEASE}")
endif()
find_library(WinToast_LIBRARY_DEBUG NAMES WinToast PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
if(EXISTS "${WinToast_LIBRARY_DEBUG}")
set_property(TARGET unofficial::wintoast::wintoast APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug")
set_target_properties(unofficial::wintoast::wintoast PROPERTIES IMPORTED_LOCATION_DEBUG "${WinToast_LIBRARY_DEBUG}")
endif()
endif()

Просмотреть файл

@ -3,23 +3,28 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mohabouje/WinToast
REF v1.2.0
SHA512 d8bd44439100772929eb8a4eb4aebfd66fa54562c838eb4c081a382dc1d73c545faa6d9675e320864d9b533e4a0c4a673e44058c7f643ccd56ec90830cdfaf45
REF "v${VERSION}"
SHA512 b9e34595049851754dafe506681af494f59edf94a4324c20aaeadea25b9ed0abac87e93384d2080c327dbbdd22441800e9af7c5ce6728d7cc1464796a83cffbd
HEAD_REF master
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_RELEASE -DINSTALL_HEADERS=ON
OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
OPTIONS
-DWINTOASTLIB_BUILD_EXAMPLES=OFF
-DWINTOASTLIB_QT_ENABLED=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_build(TARGET WinToast)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}WinToast${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
endif()
if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}WinToast${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
file(INSTALL "${SOURCE_PATH}/include/wintoastlib.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
# Install license
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" @ONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

Просмотреть файл

@ -1,7 +1,6 @@
{
"name": "wintoast",
"version": "1.2.0",
"port-version": 2,
"version": "1.3.0",
"description": "WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8 & Windows 10.",
"supports": "windows & !uwp",
"dependencies": [

Просмотреть файл

@ -9025,8 +9025,8 @@
"port-version": 0
},
"wintoast": {
"baseline": "1.2.0",
"port-version": 2
"baseline": "1.3.0",
"port-version": 0
},
"wmipp": {
"baseline": "1.2.0",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f0c791ec550f242764df15235770a4767c4e917a",
"version": "1.3.0",
"port-version": 0
},
{
"git-tree": "7e0b224e777c1a12676204204a97636e3639c4c1",
"version": "1.2.0",