Commit 81d206b3 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Move pcre package download to external_libs CMakeLists

parent b1e902c4
......@@ -43,40 +43,7 @@ target_link_libraries (
)
if (ITA_BASE_WITH_REGULAR_EXPRESSIONS)
CPMAddPackage (
NAME pcre
URL https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2
OPTIONS "PCRE_BUILD_PCREGREP OFF" "PCRE_BUILD_TESTS OFF" "PCRE_SHOW_REPORT OFF"
)
if (pcre_ADDED)
set_property (TARGET pcre PROPERTY FOLDER "external_libs")
set_property (TARGET pcrecpp PROPERTY FOLDER "external_libs")
set_property (TARGET pcreposix PROPERTY FOLDER "external_libs")
endif ()
target_link_libraries (${PROJECT_NAME} PRIVATE pcrecpp)
packageProject (
NAME pcre
VERSION 8.45
BINARY_DIR ${PROJECT_BINARY_DIR}
INCLUDE_DIR ${pcre_SOURCE_DIR}
INCLUDE_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
NAMESPACE pcre
DISABLE_VERSION_SUFFIX YES
)
packageProject (
NAME pcrecpp
VERSION 8.45
BINARY_DIR ${PROJECT_BINARY_DIR}
INCLUDE_DIR ${pcre_SOURCE_DIR}
INCLUDE_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
NAMESPACE pcre
DISABLE_VERSION_SUFFIX YES
)
endif ()
option (ITA_BASE_WITH_JSON_SUPPORT OFF "Build ITA Base with JSON support")
......
......@@ -300,3 +300,45 @@ if (vista_ADDED)
)
endif ()
if (ITA_BASE_WITH_REGULAR_EXPRESSIONS)
CPMAddPackage (
NAME pcre
URL https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2
OPTIONS "PCRE_BUILD_PCREGREP OFF" "PCRE_BUILD_TESTS OFF" "PCRE_SHOW_REPORT OFF" "BUILD_SHARED_LIBS OFF"
)
if (pcre_ADDED)
set_property (TARGET pcre PROPERTY FOLDER "external_libs")
set_property (TARGET pcrecpp PROPERTY FOLDER "external_libs")
set_property (TARGET pcreposix PROPERTY FOLDER "external_libs")
target_include_directories (
pcre PUBLIC $<BUILD_INTERFACE:${pcre_SOURCE_DIR}> $<BUILD_INTERFACE:${pcre_BINARY_DIR}>
)
target_include_directories (
pcrecpp PUBLIC $<BUILD_INTERFACE:${pcre_SOURCE_DIR}> $<BUILD_INTERFACE:${pcre_BINARY_DIR}>
)
# target_link_libraries(pcrecpp PRIVATE pcre) target_include_directories(pcrecpp PUBLIC ${pcre_SOURCE_DIR})
endif ()
packageProject (
NAME pcre
VERSION 8.45
BINARY_DIR ${PROJECT_BINARY_DIR}
INCLUDE_DIR ${pcre_SOURCE_DIR}
INCLUDE_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
NAMESPACE pcre
DISABLE_VERSION_SUFFIX YES
)
packageProject (
NAME pcrecpp
VERSION 8.45
BINARY_DIR ${PROJECT_BINARY_DIR}
INCLUDE_DIR ${pcre_SOURCE_DIR}
INCLUDE_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
NAMESPACE pcre
DISABLE_VERSION_SUFFIX YES
)
endif ()
......@@ -77,7 +77,7 @@ if (ITA_BASE_WITH_OLD_RAVEN_OPS)
target_sources (${PROJECT_NAME} PRIVATE ITAOps.cpp)
endif ()
if (VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS)
if (TARGET pcre::pcrecpp AND ITA_BASE_WITH_REGULAR_EXPRESSIONS)
target_sources (${PROJECT_NAME} PRIVATE ITAStringUtilsPCRE.cpp ITAASCIITable.cpp)
target_compile_definitions (${PROJECT_NAME} PRIVATE PCRE_STATIC)
else ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment