[simonbrunel-qtpromise] add port (#35787)

* [simonbrunel-qtpromise] add simonbrunel-qtpromise to vcpkg

* [simonbrunel-qtpromise] use version rather than version-string

* [simonbrunel-qtpromise] generate version info

* [simonbrunel-qtpromise] remove unnecessary cmake settings

* [simonbrunel-qtpromise] regenerate version info

* use quotes in portfile

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* [simonbrunel-qtpromise] regenerate version info

* [simonbrunel-qtpromise] fix qt dependency in cmake config

* [simonbrunel-qtpromise] define include directory in terms of CMAKE_CURRENT_LIST_DIR

* [simonbrunel-qtpromise] add patch for installing header files

* [simonbrunel-qtpromise] remove error flags

* [simonbrunel-qtpromise] add hint for qt5 support

* [simonbrunel-qtpromise] regenerate version info

---------

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
This commit is contained in:
Carsten Grimm 2024-01-08 22:37:34 +01:00 committed by GitHub
parent 5517637cbe
commit 614e7b491b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,17 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,14 @@ add_library(qtpromise::qtpromise ALIAS qtpromise)
target_link_libraries(qtpromise INTERFACE Qt${QT_VERSION_MAJOR}::Core)
target_include_directories(qtpromise INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include")
+if(QTPROMISE_HEADER_INSTALL_DESTINATION)
+ install(
+ DIRECTORY "include" "src"
+ DESTINATION "${QTPROMISE_HEADER_INSTALL_DESTINATION}"
+ CONFIGURATIONS "${QTPROMISE_HEADER_INSTALL_COMPONENTS}"
+ )
+endif()
+
add_definitions(
-DQT_DEPRECATED_WARNINGS
-DQT_NO_KEYWORDS

View File

@ -0,0 +1,21 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,7 @@ add_definitions(
-DQT_NO_KEYWORDS
)
+#[[ remove error flags
# https://github.com/simonbrunel/qtpromise/issues/10
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
@@ -83,8 +84,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
/WX
)
endif()
+]]
if(NOT SUBPROJECT)
enable_testing()
add_subdirectory(tests)
endif()
+

View File

@ -0,0 +1,24 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO simonbrunel/qtpromise
REF "v${VERSION}"
SHA512 0d6316ec9503a7781b4d9e615e6d538b21b6282a76e5e28e3f323bcdb740e6f66e6c55944e31fc62cec7cc25a90b0f7318277f044a630500202971ca6e2e85b6
HEAD_REF master
PATCHES
patches/install_headers.patch
patches/remove_error_flags.patch
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DQTPROMISE_HEADER_INSTALL_DESTINATION="${CURRENT_PACKAGES_DIR}/include/${PORT}"
-DQTPROMISE_HEADER_INSTALL_COMPONENTS="Release"
)
vcpkg_cmake_install()
set(USE_QT_VERSION "6") # for Qt5, replace this number with 5, and replace the dependency on port qtbase in vcpkg.json with port qt5-base
configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" @ONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

View File

@ -0,0 +1,19 @@
set(@PORT@_VERSION "@VERSION@")
if(TARGET unofficial-@PORT@)
set(unofficial-@PORT@_FOUND TRUE)
return()
endif()
include(CMakeFindDependencyMacro)
find_dependency(Qt@USE_QT_VERSION@ REQUIRED COMPONENTS Core)
add_library(unofficial-@PORT@ INTERFACE)
target_link_libraries(unofficial-@PORT@ INTERFACE Qt::Core)
target_include_directories(unofficial-@PORT@ INTERFACE "${CMAKE_CURRENT_LIST_DIR}/../../include/@PORT@/include")
set(unofficial-@PORT@_FOUND TRUE)

View File

@ -0,0 +1,4 @@
simonbrunel-qtpromise provides CMake targets:
find_package(unofficial-simonbrunel-qtpromise CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial-simonbrunel-qtpromise)

View File

@ -0,0 +1,15 @@
{
"name": "simonbrunel-qtpromise",
"version": "0.7.0",
"maintainers": "Simon Brunel",
"description": "Promises/A+ implementation for Qt/C++",
"homepage": "https://qtpromise.netlify.app/",
"license": "MIT",
"dependencies": [
"qtbase",
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -7920,6 +7920,10 @@
"baseline": "3.2.16",
"port-version": 0
},
"simonbrunel-qtpromise": {
"baseline": "0.7.0",
"port-version": 0
},
"simple-fft": {
"baseline": "2020-06-14",
"port-version": 2

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "b416eec5f84996491c4656f6b01723453abac31f",
"version": "0.7.0",
"port-version": 0
}
]
}