diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-10-13 14:46:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-13 14:46:28 -0700 |
| commit | cebe05184119cfabcc8f5c0e71c8673c22a1487b (patch) | |
| tree | 4399850d61029f99fd0d36a09deda305e5fa9a90 /ports/utfcpp | |
| parent | 0a41fb2dfa6b0714da83e00aa3802302c7ec7fb4 (diff) | |
| download | vcpkg-cebe05184119cfabcc8f5c0e71c8673c22a1487b.tar.gz vcpkg-cebe05184119cfabcc8f5c0e71c8673c22a1487b.zip | |
[utfcpp] Use vcpkg_*_cmake and add features (#13521)
Diffstat (limited to 'ports/utfcpp')
| -rw-r--r-- | ports/utfcpp/CONTROL | 3 | ||||
| -rw-r--r-- | ports/utfcpp/fix-test.patch | 36 | ||||
| -rw-r--r-- | ports/utfcpp/portfile.cmake | 23 |
3 files changed, 59 insertions, 3 deletions
diff --git a/ports/utfcpp/CONTROL b/ports/utfcpp/CONTROL index 88cdd692d..11be1813c 100644 --- a/ports/utfcpp/CONTROL +++ b/ports/utfcpp/CONTROL @@ -1,4 +1,5 @@ Source: utfcpp
Version: 3.1.2
+Port-Version: 1
Homepage: https://github.com/nemtrif/utfcpp
-Description: UTF-8 with C++ in a Portable Way
+Description: UTF-8 with C++ in a Portable Way
\ No newline at end of file diff --git a/ports/utfcpp/fix-test.patch b/ports/utfcpp/fix-test.patch new file mode 100644 index 000000000..43799c922 --- /dev/null +++ b/ports/utfcpp/fix-test.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8ac1646..c081d3d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -38,6 +38,6 @@ endif() + + if(UTF8_TESTS) + enable_testing() +- add_subdirectory(extern/gtest) ++ find_package(GTest CONFIG REQUIRED) + add_subdirectory(tests) + endif() +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 06e0d7e..4ee6dd8 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -15,16 +15,16 @@ add_executable(noexceptionstests + target_link_libraries(negative PRIVATE utf8::cpp) + target_link_libraries(cpp11 PRIVATE + utf8::cpp +- gtest_main ++ GTest::gtest_main + ) + target_link_libraries(apitests PRIVATE + utf8::cpp +- gtest_main ++ GTest::gtest_main + ) + + target_link_libraries(noexceptionstests PRIVATE + utf8::cpp +- gtest_main ++ GTest::gtest_main + ) + target_compile_options(noexceptionstests PUBLIC -fno-exceptions) + diff --git a/ports/utfcpp/portfile.cmake b/ports/utfcpp/portfile.cmake index a39283751..9dddfb1d0 100644 --- a/ports/utfcpp/portfile.cmake +++ b/ports/utfcpp/portfile.cmake @@ -4,8 +4,27 @@ vcpkg_from_github( REF v3.1.2 SHA512 d43df19d9e8652291f1301a326ec0d592bad43d6ecf9086947037f0ae0c1e70c2d96082c48066639e2b7c57c0ea0e4782d6b215d017cf96a4c73ff3a15feec75 HEAD_REF master + PATCHES fix-test.patch ) -file(COPY ${SOURCE_PATH}/source/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DUTF8_INSTALL=ON + -DUTF8_SAMPLES=OFF + -DUTF8_TESTS=OFF +) + +vcpkg_install_cmake() + +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/utf8cpp) +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/utf8cpp TARGET_PATH share/utf8cpp) +endif() + +# Header only +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${SOURCE_PATH}/source/utf8.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
\ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
\ No newline at end of file |
