From a2c6f1a9306159fb3aadd60ed13864c06120493d Mon Sep 17 00:00:00 2001 From: Robert Kesteson Date: Mon, 14 Sep 2020 19:46:46 -0400 Subject: [PATCH] [croncpp] Added croncpp port (#13359) * Added croncpp port * Update croncpp for windows failure * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher * Update ports/croncpp/CONTROL Co-authored-by: Robert Schumacher * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Kesterson Co-authored-by: Robert Schumacher --- ports/croncpp/0001-fix-cmake.patch | 82 ++++++++++++++++++++++++++++++ ports/croncpp/CONTROL | 5 ++ ports/croncpp/portfile.cmake | 26 ++++++++++ 3 files changed, 113 insertions(+) create mode 100644 ports/croncpp/0001-fix-cmake.patch create mode 100644 ports/croncpp/CONTROL create mode 100644 ports/croncpp/portfile.cmake diff --git a/ports/croncpp/0001-fix-cmake.patch b/ports/croncpp/0001-fix-cmake.patch new file mode 100644 index 0000000000..735c9df34a --- /dev/null +++ b/ports/croncpp/0001-fix-cmake.patch @@ -0,0 +1,82 @@ +From 30db118abd484c59efada27d9d6956b5f68bcee6 Mon Sep 17 00:00:00 2001 +From: Robert Kesterson +Date: Fri, 4 Sep 2020 16:31:55 +0000 +Subject: [PATCH] vcpkg + +--- + CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++-- + croncppConfig.cmake | 1 + + 2 files changed, 46 insertions(+), 2 deletions(-) + create mode 100644 croncppConfig.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9114b39..8d46e6b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + cmake_minimum_required(VERSION 3.7.0) +-project(croncpp) ++project(croncpp VERSION 1.0.0) + + if(WIN32) + message(status "Setting MSVC flags") +@@ -24,4 +24,47 @@ if(BUILD_TESTS) + endif() + + add_subdirectory(benchmark) +-add_subdirectory(test) +\ No newline at end of file ++add_subdirectory(test) ++ ++add_library( croncpp INTERFACE ) ++add_library( croncpp::croncpp ALIAS croncpp ) ++ ++include(GNUInstallDirs) ++target_include_directories( croncpp INTERFACE ++ $ ++ $ ) ++ ++if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15) ++ # public headers will get installed: ++ set_target_properties( croncpp PROPERTIES PUBLIC_HEADER include/croncpp.h ) ++endif () ++ ++ ++set( version_config "${CMAKE_CURRENT_BINARY_DIR}/croncppConfigVersion.cmake" ) ++ ++include( CMakePackageConfigHelpers ) ++write_basic_package_version_file( "${version_config}" ++ VERSION ${PROJECT_VERSION} ++ COMPATIBILITY SameMajorVersion ) ++ ++message(STATUS "CMAKE_INSTALL_INCLUDEDIR = ${CMAKE_INSTALL_INCLUDEDIR}") ++ ++install( TARGETS croncpp ++ EXPORT croncppConfig ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/croncpp ) ++export( TARGETS croncpp NAMESPACE croncpp:: FILE croncppTargets.cmake ) ++if (CMAKE_VERSION VERSION_LESS 3.15) ++ install( ++ FILES include/croncpp.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/croncpp ) ++endif () ++ ++set( CONFIG_LOC "share/croncpp" ) ++ ++install( EXPORT croncppConfig ++ FILE croncppTargets.cmake ++ NAMESPACE croncpp:: ++ DESTINATION ${CONFIG_LOC} ) ++install ( ++ FILES croncppConfig.cmake "${version_config}" ++ DESTINATION ${CONFIG_LOC}) +diff --git a/croncppConfig.cmake b/croncppConfig.cmake +new file mode 100644 +index 0000000..3c4702c +--- /dev/null ++++ b/croncppConfig.cmake +@@ -0,0 +1 @@ ++include( "${CMAKE_CURRENT_LIST_DIR}/croncppTargets.cmake" ) +-- +2.20.1 + diff --git a/ports/croncpp/CONTROL b/ports/croncpp/CONTROL new file mode 100644 index 0000000000..32ef3b907f --- /dev/null +++ b/ports/croncpp/CONTROL @@ -0,0 +1,5 @@ +Source: croncpp +Version: 2020-09-04 +Port-Version: 1 +Homepage: https://github.com/mariusbancila/croncpp +Description: croncpp is a C++17 header-only cross-platform library for handling CRON expressions. diff --git a/ports/croncpp/portfile.cmake b/ports/croncpp/portfile.cmake new file mode 100644 index 0000000000..dee2100854 --- /dev/null +++ b/ports/croncpp/portfile.cmake @@ -0,0 +1,26 @@ + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mariusbancila/croncpp + REF 11cce4666a06c40346c7ba380ddd90c53806809d #master on 9/4/2020 + SHA512 8f4d892ce90d8eca3711b21728bb599bf64857b20c0b143c5277687d0b6e5d5b8bf3e6dc7f9e8d028ba4e5ee711a5a9e750bcc2f771177d2f659c0c19e12207a + HEAD_REF master + PATCHES 0001-fix-cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/croncpp RENAME copyright) + +# # Post-build test for cmake libraries +vcpkg_test_cmake(PACKAGE_NAME croncpp)