aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2023-12-06 12:30:51 +1000
committerGitHub <noreply@github.com>2023-12-06 12:30:51 +1000
commitc001033eb23eae74d8c29628d106580c0c2838c6 (patch)
treee39a6b2eed78a4c709a4d6adf88256110bd69b69 /cmake
parentc966f681e766b53aad6bb5b6e25b7ec8c9ee5842 (diff)
parentcf58aefdce70af4bdd3ac8aa0d9b892efa761a71 (diff)
Merge pull request #24128 from rschupp/remove-pcrecpp
Remove use of pcrecpp from Kodi
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindPCRE.cmake59
1 files changed, 6 insertions, 53 deletions
diff --git a/cmake/modules/FindPCRE.cmake b/cmake/modules/FindPCRE.cmake
index 3ef52a2f25..811aa3fcb2 100644
--- a/cmake/modules/FindPCRE.cmake
+++ b/cmake/modules/FindPCRE.cmake
@@ -1,11 +1,10 @@
#.rst:
# FindPCRE
# --------
-# Finds the PCRECPP library
+# Finds the PCRE library
#
# This will define the following targets:
#
-# PCRE::PCRECPP - The PCRECPP library
# PCRE::PCRE - The PCRE library
macro(buildPCRE)
@@ -44,15 +43,11 @@ macro(buildPCRE)
list(APPEND CMAKE_ARGS -DHAVE_STRTOQ=0)
endif()
- # populate PCRECPP lib without a separate module
+ # populate PCRE lib without a separate module
if(NOT CORE_SYSTEM_NAME MATCHES windows)
# Non windows platforms have a lib prefix for the lib artifact
set(_libprefix "lib")
endif()
- # regex used to get platform extension (eg lib for windows, .a for unix)
- string(REGEX REPLACE "^.*\\." "" _LIBEXT ${${MODULE}_BYPRODUCT})
- set(PCRECPP_LIBRARY_DEBUG ${DEP_LOCATION}/lib/${_libprefix}pcrecpp${${MODULE}_DEBUG_POSTFIX}.${_LIBEXT})
- set(PCRECPP_LIBRARY_RELEASE ${DEP_LOCATION}/lib/${_libprefix}pcrecpp.${_LIBEXT})
BUILD_DEP_TARGET()
endmacro()
@@ -78,25 +73,17 @@ if(NOT PCRE::pcre)
else()
if(NOT TARGET PCRE::pcre)
if(PKG_CONFIG_FOUND)
- pkg_check_modules(PC_PCRE pcre pcrecpp QUIET)
+ pkg_check_modules(PC_PCRE pcre QUIET)
endif()
- find_path(PCRE_INCLUDE_DIR pcrecpp.h
+ find_path(PCRE_INCLUDE_DIR pcre.h
HINTS ${DEPENDS_PATH}/include ${PC_PCRE_INCLUDEDIR}
${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}
NO_CACHE)
- find_library(PCRECPP_LIBRARY_RELEASE NAMES pcrecpp
- HINTS ${DEPENDS_PATH}/lib ${PC_PCRE_LIBDIR}
- ${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}
- NO_CACHE)
find_library(PCRE_LIBRARY_RELEASE NAMES pcre
HINTS ${DEPENDS_PATH}/lib ${PC_PCRE_LIBDIR}
${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}
NO_CACHE)
- find_library(PCRECPP_LIBRARY_DEBUG NAMES pcrecppd
- HINTS ${DEPENDS_PATH}/lib ${PC_PCRE_LIBDIR}
- ${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}
- NO_CACHE)
find_library(PCRE_LIBRARY_DEBUG NAMES pcred
HINTS ${DEPENDS_PATH}/lib ${PC_PCRE_LIBDIR}
${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}
@@ -116,27 +103,14 @@ if(NOT PCRE::pcre)
endif()
endforeach()
- get_target_property(_PCRECPP_CONFIGURATIONS PCRE::pcrecpp IMPORTED_CONFIGURATIONS)
- foreach(_pcrecpp_config IN LISTS _PCRECPP_CONFIGURATIONS)
- # Just set to RELEASE var so select_library_configurations can continue to work its magic
- if((NOT ${_pcrecpp_config} STREQUAL "RELEASE") AND
- (NOT ${_pcrecpp_config} STREQUAL "DEBUG"))
- get_target_property(PCRECPP_LIBRARY_RELEASE PCRE::pcrecpp IMPORTED_LOCATION_${_pcrecpp_config})
- else()
- get_target_property(PCRECPP_LIBRARY_${_pcrecpp_config} PCRE::pcrecpp IMPORTED_LOCATION_${_pcrecpp_config})
- endif()
- endforeach()
-
# ToDo: patch PCRE cmake to include includedir in config file
- find_path(PCRE_INCLUDE_DIR pcrecpp.h
+ find_path(PCRE_INCLUDE_DIR pcre.h
HINTS ${DEPENDS_PATH}/include ${PC_PCRE_INCLUDEDIR}
${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}
NO_CACHE)
set_target_properties(PCRE::pcre PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}")
- set_target_properties(PCRE::pcrecpp PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}")
endif()
endif()
@@ -145,14 +119,12 @@ if(NOT PCRE::pcre)
endif()
include(SelectLibraryConfigurations)
- select_library_configurations(PCRECPP)
select_library_configurations(PCRE)
- unset(PCRECPP_LIBRARIES)
unset(PCRE_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCRE
- REQUIRED_VARS PCRECPP_LIBRARY PCRE_LIBRARY PCRE_INCLUDE_DIR
+ REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR
VERSION_VAR PCRE_VERSION)
if(PCRE_FOUND)
@@ -171,33 +143,15 @@ if(NOT PCRE::pcre)
set_target_properties(PCRE::pcre PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}")
endif()
- if(NOT TARGET PCRE::pcrecpp)
- add_library(PCRE::pcrecpp UNKNOWN IMPORTED)
- if(PCRECPP_LIBRARY_RELEASE)
- set_target_properties(PCRE::pcrecpp PROPERTIES
- IMPORTED_CONFIGURATIONS RELEASE
- IMPORTED_LOCATION_RELEASE "${PCRECPP_LIBRARY_RELEASE}")
- endif()
- if(PCRECPP_LIBRARY_DEBUG)
- set_target_properties(PCRE::pcrecpp PROPERTIES
- IMPORTED_CONFIGURATIONS DEBUG
- IMPORTED_LOCATION_DEBUG "${PCRECPP_LIBRARY_DEBUG}")
- endif()
- set_target_properties(PCRE::pcrecpp PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${PCRE_INCLUDE_DIR}")
- endif()
# Wee need to explicitly add this define. The cmake config does not propagate this info
if(WIN32)
set_property(TARGET PCRE::pcre APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PCRE_STATIC=1")
- set_property(TARGET PCRE::pcrecpp APPEND PROPERTY
- INTERFACE_COMPILE_DEFINITIONS "PCRE_STATIC=1")
endif()
if(TARGET pcre)
add_dependencies(PCRE::pcre pcre)
- add_dependencies(PCRE::pcrecpp pcre)
endif()
# Add internal build target when a Multi Config Generator is used
@@ -217,7 +171,6 @@ if(NOT PCRE::pcre)
endif()
set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP PCRE::pcre)
- set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP PCRE::pcrecpp)
endif()
endif()