mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[croncpp] Added croncpp port (#13359)
* Added croncpp port * Update croncpp for windows failure * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/croncpp/CONTROL Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Schumacher <roschuma@microsoft.com> * Update ports/croncpp/portfile.cmake Co-authored-by: Robert Kesterson <robert.d.kesterson@leidos.com> Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
This commit is contained in:
parent
5c9e670767
commit
a2c6f1a930
82
ports/croncpp/0001-fix-cmake.patch
Normal file
82
ports/croncpp/0001-fix-cmake.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 30db118abd484c59efada27d9d6956b5f68bcee6 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Kesterson <robert.d.kesterson@leidos.com>
|
||||
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
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
+ $<INSTALL_INTERFACE:include> )
|
||||
+
|
||||
+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
|
||||
|
5
ports/croncpp/CONTROL
Normal file
5
ports/croncpp/CONTROL
Normal file
@ -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.
|
26
ports/croncpp/portfile.cmake
Normal file
26
ports/croncpp/portfile.cmake
Normal file
@ -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)
|
Loading…
x
Reference in New Issue
Block a user