diff --git a/ports/simonbrunel-qtpromise/patches/install_headers.patch b/ports/simonbrunel-qtpromise/patches/install_headers.patch new file mode 100644 index 0000000000..6bbbd98ad6 --- /dev/null +++ b/ports/simonbrunel-qtpromise/patches/install_headers.patch @@ -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 diff --git a/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch b/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch new file mode 100644 index 0000000000..8499cbcfdb --- /dev/null +++ b/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch @@ -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() ++ diff --git a/ports/simonbrunel-qtpromise/portfile.cmake b/ports/simonbrunel-qtpromise/portfile.cmake new file mode 100644 index 0000000000..e0907e4974 --- /dev/null +++ b/ports/simonbrunel-qtpromise/portfile.cmake @@ -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) diff --git a/ports/simonbrunel-qtpromise/unofficial-config.cmake.in b/ports/simonbrunel-qtpromise/unofficial-config.cmake.in new file mode 100644 index 0000000000..2458704aa6 --- /dev/null +++ b/ports/simonbrunel-qtpromise/unofficial-config.cmake.in @@ -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) + diff --git a/ports/simonbrunel-qtpromise/usage b/ports/simonbrunel-qtpromise/usage new file mode 100644 index 0000000000..ed536b15eb --- /dev/null +++ b/ports/simonbrunel-qtpromise/usage @@ -0,0 +1,4 @@ +simonbrunel-qtpromise provides CMake targets: + +find_package(unofficial-simonbrunel-qtpromise CONFIG REQUIRED) +target_link_libraries(main PRIVATE unofficial-simonbrunel-qtpromise) \ No newline at end of file diff --git a/ports/simonbrunel-qtpromise/vcpkg.json b/ports/simonbrunel-qtpromise/vcpkg.json new file mode 100644 index 0000000000..6917e4407b --- /dev/null +++ b/ports/simonbrunel-qtpromise/vcpkg.json @@ -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 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 7aa62358c8..44f14eb50c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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 diff --git a/versions/s-/simonbrunel-qtpromise.json b/versions/s-/simonbrunel-qtpromise.json new file mode 100644 index 0000000000..dfe3f3acb9 --- /dev/null +++ b/versions/s-/simonbrunel-qtpromise.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "b416eec5f84996491c4656f6b01723453abac31f", + "version": "0.7.0", + "port-version": 0 + } + ] +}