mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-02 17:52:19 +00:00
Fix PCRECPP detection in CMake script
This commit is contained in:
2 files changed
+36
-6
No files matched your search
+3
-6
@@ -56,12 +56,9 @@ LINK_DIRECTORIES(${YAML_CPP_LIBRARY_DIRS})
|
|||||||
INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIRS})
|
||||||
TARGET_LINK_LIBRARIES(subconverter ${YAML_CPP_LIBRARY})
|
TARGET_LINK_LIBRARIES(subconverter ${YAML_CPP_LIBRARY})
|
||||||
|
|
||||||
PKG_CHECK_MODULES(PCRE libpcre REQUIRED)
|
FIND_PACKAGE(PCRECPP REQUIRED)
|
||||||
FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h PATHS ${PCRE_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${PCRECPP_INCLUDE_DIRS})
|
||||||
FIND_LIBRARY(PCRE_LIBRARY NAMES pcrecpp pcre PATHS ${PCRE_LIBRARY_DIRS})
|
TARGET_LINK_LIBRARIES(subconverter ${PCRECPP_LIBRARIES})
|
||||||
LINK_DIRECTORIES(${PCRE_LIBRARY_DIRS})
|
|
||||||
INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
|
|
||||||
TARGET_LINK_LIBRARIES(subconverter ${PCRE_LIBRARY})
|
|
||||||
ADD_DEFINITIONS(-DPCRE_STATIC)
|
ADD_DEFINITIONS(-DPCRE_STATIC)
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# - Find PCRECPP
|
||||||
|
# Find the native PCRECPP headers and libraries.
|
||||||
|
#
|
||||||
|
# PCRECPP_INCLUDE_DIRS - where to find pcre.h, etc.
|
||||||
|
# PCRECPP_LIBRARIES - List of libraries when using pcrecpp
|
||||||
|
# PCRECPP_FOUND - True if pcrecpp found.
|
||||||
|
|
||||||
|
# Look for the header file.
|
||||||
|
FIND_PATH(PCRECPP_INCLUDE_DIR NAMES pcrecpp.h)
|
||||||
|
MARK_AS_ADVANCED(PCRECPP_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# Look for the library.
|
||||||
|
FIND_LIBRARY(PCRECPP_LIBRARY NAMES
|
||||||
|
pcrecpp
|
||||||
|
pcrecppd
|
||||||
|
)
|
||||||
|
MARK_AS_ADVANCED(PCRECPP_LIBRARY)
|
||||||
|
|
||||||
|
FIND_LIBRARY(PCRE_LIBRARY NAMES
|
||||||
|
pcre
|
||||||
|
pcred
|
||||||
|
)
|
||||||
|
MARK_AS_ADVANCED(PCRE_LIBRARY)
|
||||||
|
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set PCRECPP_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRECPP DEFAULT_MSG PCRECPP_LIBRARY PCRECPP_INCLUDE_DIR PCRE_LIBRARY)
|
||||||
|
|
||||||
|
IF(PCRECPP_FOUND)
|
||||||
|
SET(PCRECPP_LIBRARIES ${PCRECPP_LIBRARY} ${PCRE_LIBRARY})
|
||||||
|
SET(PCRECPP_INCLUDE_DIRS ${PCRECPP_INCLUDE_DIR})
|
||||||
|
ENDIF(PCRECPP_FOUND)
|
||||||
Reference in new issue
Block a user