Browse Source

Create findPCRE.cmake

marauder2k7 8 tháng trước cách đây
mục cha
commit
9f88688680
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      Tools/CMake/finders/findPCRE.cmake

+ 13 - 0
Tools/CMake/finders/findPCRE.cmake

@@ -0,0 +1,13 @@
+if(TARGET pcre)
+  set(PCRE_FOUND TRUE)
+  set(PCRE_INCLUDE_DIRS $<TARGET_PROPERTY:pcre,INTERFACE_INCLUDE_DIRECTORIES>)
+  set(PCRE_LIBRARIES pcre)
+
+  # Provide an alias for consistency with modern CMake
+  if(NOT TARGET PCRE::PCRE)
+    add_library(PCRE::PCRE ALIAS pcre)
+  endif()
+else()
+  set(PCRE_FOUND FALSE)
+  message(FATAL_ERROR "PCRE was not added with add_subdirectory before calling find_package(PCRE).")
+endif()