2022-03-05 05:30:30 +08:00
|
|
|
diff --git a/cmake/SelectRegex.cmake b/cmake/SelectRegex.cmake
|
|
|
|
index 2a3a91b8c..cbb409350 100644
|
|
|
|
--- a/cmake/SelectRegex.cmake
|
|
|
|
+++ b/cmake/SelectRegex.cmake
|
|
|
|
@@ -1,5 +1,4 @@
|
2021-11-28 15:32:06 +08:00
|
|
|
# Specify regular expression implementation
|
2022-03-05 05:30:30 +08:00
|
|
|
-find_package(PCRE)
|
2021-11-28 15:32:06 +08:00
|
|
|
|
2022-03-05 05:30:30 +08:00
|
|
|
if(REGEX_BACKEND STREQUAL "")
|
|
|
|
check_symbol_exists(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
|
|
|
|
@@ -33,8 +32,8 @@ elseif(REGEX_BACKEND STREQUAL "pcre")
|
|
|
|
add_feature_info(regex ON "using system PCRE")
|
|
|
|
set(GIT_REGEX_PCRE 1)
|
2021-11-28 15:32:06 +08:00
|
|
|
|
2022-03-05 05:30:30 +08:00
|
|
|
- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE_INCLUDE_DIRS})
|
|
|
|
- list(APPEND LIBGIT2_SYSTEM_LIBS ${PCRE_LIBRARIES})
|
|
|
|
+ find_package(unofficial-pcre CONFIG REQUIRED)
|
|
|
|
+ list(APPEND LIBGIT2_SYSTEM_LIBS unofficial::pcre::pcre)
|
|
|
|
list(APPEND LIBGIT2_PC_REQUIRES "libpcre")
|
|
|
|
elseif(REGEX_BACKEND STREQUAL "regcomp")
|
|
|
|
add_feature_info(regex ON "using system regcomp")
|
2023-05-31 03:31:00 +08:00
|
|
|
diff --git a/src/libgit2/CMakeLists.txt b/src/libgit2/CMakeLists.txt
|
|
|
|
index 876a703e8..8283f9585 100644
|
|
|
|
--- a/src/libgit2/CMakeLists.txt
|
|
|
|
+++ b/src/libgit2/CMakeLists.txt
|
|
|
|
@@ -110,10 +110,28 @@ FILE(WRITE "${PROJECT_BINARY_DIR}/include/${LIBGIT2_FILENAME}.h" ${LIBGIT2_INCLU
|
2021-11-28 15:32:06 +08:00
|
|
|
|
|
|
|
# Install
|
2023-05-31 03:31:00 +08:00
|
|
|
|
|
|
|
-install(TARGETS libgit2package
|
|
|
|
+install(TARGETS libgit2package EXPORT unofficial-git2Targets
|
2021-11-28 15:32:06 +08:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2023-05-31 03:31:00 +08:00
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2021-11-28 15:32:06 +08:00
|
|
|
+
|
|
|
|
+install(EXPORT unofficial-git2Targets
|
|
|
|
+ NAMESPACE unofficial::git2::
|
|
|
|
+ DESTINATION share/unofficial-git2
|
|
|
|
+)
|
|
|
|
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake.in"
|
|
|
|
+[[include(CMakeFindDependencyMacro)
|
2022-03-05 05:30:30 +08:00
|
|
|
+if(@USE_BUNDLED_ZLIB@ STREQUAL "OFF")
|
2021-11-28 15:32:06 +08:00
|
|
|
+ find_dependency(ZLIB)
|
2022-03-05 05:30:30 +08:00
|
|
|
+endif()
|
|
|
|
+if(@REGEX_BACKEND@ STREQUAL "pcre")
|
2021-11-28 15:32:06 +08:00
|
|
|
+ find_dependency(unofficial-pcre CONFIG)
|
2022-03-05 05:30:30 +08:00
|
|
|
+endif()
|
2021-11-28 15:32:06 +08:00
|
|
|
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-git2Targets.cmake")
|
|
|
|
+]])
|
|
|
|
+configure_file("${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake" @ONLY)
|
|
|
|
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake DESTINATION share/unofficial-git2)
|
|
|
|
+
|
2023-05-31 03:31:00 +08:00
|
|
|
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/git2/
|
|
|
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBGIT2_FILENAME}")
|
|
|
|
install(FILES ${PROJECT_BINARY_DIR}/include/git2/experimental.h
|