From 4962638f66ddf59f6a304dd98d3a2dc195133ada Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 22 Nov 2023 05:05:40 +0200 Subject: [PATCH] [tre] Add CMake config files. (#35134) * [tre] Add CMake config files. * Fix license. * Address PR feedback. Co-authored-by: LilyWangLL <494550702@qq.com> Co-authored-by: Kai Pastor * Update version database. --------- Co-authored-by: LilyWangLL <494550702@qq.com> Co-authored-by: Kai Pastor --- ports/tre/CMakeLists.txt | 9 +++++++++ ports/tre/portfile.cmake | 6 +++++- ports/tre/usage | 4 ++++ ports/tre/vcpkg.json | 7 ++++++- versions/baseline.json | 2 +- versions/t-/tre.json | 5 +++++ 6 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 ports/tre/usage diff --git a/ports/tre/CMakeLists.txt b/ports/tre/CMakeLists.txt index b31aa8c72d4..bfef8210a3a 100644 --- a/ports/tre/CMakeLists.txt +++ b/ports/tre/CMakeLists.txt @@ -30,11 +30,20 @@ if (WIN32) endif() add_library(tre ${SRCS}) +target_include_directories(tre PUBLIC "$") + install( TARGETS tre + EXPORT unofficial-tre-targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) +install( + EXPORT unofficial-tre-targets + NAMESPACE unofficial::tre:: + FILE unofficial-tre-config.cmake + DESTINATION share/unofficial-tre) + install(FILES ${HEADERS} DESTINATION include/tre) diff --git a/ports/tre/portfile.cmake b/ports/tre/portfile.cmake index e6ce5e118e0..1bb2e7c9093 100644 --- a/ports/tre/portfile.cmake +++ b/ports/tre/portfile.cmake @@ -13,13 +13,17 @@ if(VCPKG_TARGET_IS_MINGW) endif() file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" ) vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/tre" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/tre/usage b/ports/tre/usage new file mode 100644 index 00000000000..df5d666eb78 --- /dev/null +++ b/ports/tre/usage @@ -0,0 +1,4 @@ +tre provides CMake targets: + + find_package(unofficial-tre CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::tre::tre) diff --git a/ports/tre/vcpkg.json b/ports/tre/vcpkg.json index f4402a1c6b5..e4ce1b25f26 100644 --- a/ports/tre/vcpkg.json +++ b/ports/tre/vcpkg.json @@ -1,13 +1,18 @@ { "name": "tre", "version": "0.8.0", - "port-version": 5, + "port-version": 6, "description": "TRE is a lightweight, robust, and efficient POSIX compliant regexp matching library with some exciting features such as approximate (fuzzy) matching.", "homepage": "https://github.com/laurikari/tre", + "license": "BSD-2-Clause", "dependencies": [ { "name": "vcpkg-cmake", "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 50a0c36837b..4552e1cd2b6 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8546,7 +8546,7 @@ }, "tre": { "baseline": "0.8.0", - "port-version": 5 + "port-version": 6 }, "tree-similarity": { "baseline": "0.1.1", diff --git a/versions/t-/tre.json b/versions/t-/tre.json index ce0b5be2805..18364696929 100644 --- a/versions/t-/tre.json +++ b/versions/t-/tre.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "307fd730a8de00228602333743300ebadc2b301c", + "version": "0.8.0", + "port-version": 6 + }, { "git-tree": "601cf1197e7f531cf374926d949163b9c4bb8331", "version": "0.8.0",