Skip to content

Commit

Permalink
[tre] Add CMake config files. (#35134)
Browse files Browse the repository at this point in the history
* [tre] Add CMake config files.

* Fix license.

* Address PR feedback.

Co-authored-by: LilyWangLL <[email protected]>
Co-authored-by: Kai Pastor <[email protected]>

* Update version database.

---------

Co-authored-by: LilyWangLL <[email protected]>
Co-authored-by: Kai Pastor <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2023
1 parent dfbe9e7 commit 4962638
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ports/tre/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,20 @@ if (WIN32)
endif()
add_library(tre ${SRCS})

target_include_directories(tre PUBLIC "$<INSTALL_INTERFACE:include>")

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)
6 changes: 5 additions & 1 deletion ports/tre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
4 changes: 4 additions & 0 deletions ports/tre/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tre provides CMake targets:

find_package(unofficial-tre CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::tre::tre)
7 changes: 6 additions & 1 deletion ports/tre/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8546,7 +8546,7 @@
},
"tre": {
"baseline": "0.8.0",
"port-version": 5
"port-version": 6
},
"tree-similarity": {
"baseline": "0.1.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tre.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "307fd730a8de00228602333743300ebadc2b301c",
"version": "0.8.0",
"port-version": 6
},
{
"git-tree": "601cf1197e7f531cf374926d949163b9c4bb8331",
"version": "0.8.0",
Expand Down

0 comments on commit 4962638

Please sign in to comment.