diff options
Diffstat (limited to 'cmake/FindPCRE2.cmake')
-rw-r--r-- | cmake/FindPCRE2.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/FindPCRE2.cmake b/cmake/FindPCRE2.cmake new file mode 100644 index 0000000000..3977532124 --- /dev/null +++ b/cmake/FindPCRE2.cmake @@ -0,0 +1,13 @@ + +find_library(PCRE2_LIBRARIES NAMES pcre2-16) +find_path(PCRE2_INCLUDE_DIRS pcre2.h) + +if (PCRE2_LIBRARIES STREQUAL "PCRE2_LIBRARIES-NOTFOUND" OR PCRE2_INCLUDE_DIRS STREQUAL "PCRE2_INCLUDE_DIRS-NOTFOUND") + set(PCRE2_FOUND 0) +else() + add_library(PCRE2 INTERFACE IMPORTED) + target_link_libraries(PCRE2 INTERFACE ${PCRE2_LIBRARIES}) + target_include_directories(PCRE2 INTERFACE ${PCRE2_INCLUDE_DIRS}) + set(PCRE2_FOUND 1) +endif() + |