[Polymorphic-value] Add new port (#10267)

* add polymorphic_value

* make head work

* fix the config file

* address polymorphic_value review comments

* use ${PORT} instead of literal name
This commit is contained in:
nicole mazzuca 2020-03-05 13:58:02 -08:00 committed by GitHub
parent 8cd675cc58
commit 961378b1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,33 @@
diff --git C:/Users/Charles Barto/Source/vcpkg/buildtrees/polymorphic-value/src/1.3.0-33dc249788/CMakeLists.txt C:/Users/Charles Barto/patched_list.txt
index 2819bf6a4..0ee5fba76 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,9 +9,9 @@ set(POLYMOPHIC_VALUE_VERSION "1.3.0") # Revision 3, see paper p0201r3
project(polymorphic_value VERSION ${POLYMOPHIC_VALUE_VERSION})
option(ENABLE_SANITIZERS "Enable Address Sanitizer and Undefined Behaviour Sanitizer if available" OFF)
-
+if(BUILD_TESTING)
add_subdirectory(externals/catch)
-
+endif()
add_library(polymorphic_value INTERFACE)
target_include_directories(polymorphic_value
INTERFACE
@@ -45,6 +45,7 @@ target_compile_features(polymorphic_value
add_library(polymorphic_value::polymorphic_value ALIAS polymorphic_value)
if(POLYMORPHIC_IS_NOT_SUBPROJECT)
+ if(BUILD_TESTING)
add_executable(test_polymorphic_value test_polymorphic_value.cpp)
target_link_libraries(test_polymorphic_value
PRIVATE
@@ -107,7 +108,7 @@ if(POLYMORPHIC_IS_NOT_SUBPROJECT)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/externals/catch/contrib)
include(Catch)
catch_discover_tests(test_polymorphic_value)
-
+ endif()
install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/polymorphic_value.h"

View File

@ -0,0 +1,14 @@
diff --git a/./broken_config.cmake.in b/./fixed_config.cmake.in
index e64f8a20f..38c441451 100644
--- a/polymorphic_value-config.cmake.in
+++ b/polymorphic_value-config.cmake.in
@@ -1,5 +1,7 @@
@PACKAGE_INIT@
-set_and_check(POLYMORPHIC_VALUE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-check_required_components(Foo)
+
+check_required_components(polymorphic_value)
+
+include(${CMAKE_CURRENT_LIST_DIR}/polymorphic_value-target.cmake)

View File

@ -0,0 +1,4 @@
Source: polymorphic-value
Version: 1.3.0-1
Description: A polymorphic value-type for C++
Homepage: https://github.com/jbcoe/polymorphic_value

View File

@ -0,0 +1,32 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jbcoe/polymorphic_value
REF 1.3.0
SHA512 67d49933c46d2a2bccb68c65c6f28b92603e193c68ff434b2c6b1602a573855a176fc98227d85cd24a64ae9299461adb42e792b4f165482bb250488620161742
HEAD_REF master
PATCHES 001_no_catch_submodule.patch
002_fixed_config.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_TESTING=OFF
)
vcpkg_install_cmake()
if(VCPKG_HEAD_VERSION)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/polymorphic_value TARGET_PATH share/polymorphic_value)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/polymorphic_value)
file(REMOVE "${CURRENT_PACKAGES_DIR}/LICENSE.txt")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
file(
INSTALL ${SOURCE_PATH}/LICENSE.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
RENAME copyright
)