FindPCRE.cmake 771 B

123456789101112131415161718192021222324252627282930
  1. # PCRE_FOUND
  2. # PCRE_LIBRARIES
  3. # PCRE_LIBRARY_DIRS
  4. # PCRE_LDFLAGS
  5. # PCRE_INCLUDE_DIRS
  6. # PCRE_CFLAGS
  7. if (NOT KS_PLAT_WIN)
  8. include(FindPkgConfig)
  9. if (NOT PKG_CONFIG_FOUND)
  10. message("Failed to locate pkg-config" FATAL)
  11. endif()
  12. pkg_check_modules(PCRE libpcre REQUIRED)
  13. else()
  14. # On windows we expect the build env to have a setup target already
  15. # as we just created a libpcre repo with the pre-build libs and includes
  16. if (NOT TARGET pcre)
  17. message(FATAL_ERROR "libpcre target not loaded")
  18. endif()
  19. # We just have to declare the library, since we use the interface systme
  20. # all include paths and link rules will be inherited automatically
  21. set(PCRE_LIBRARIES pcre)
  22. get_target_property(PCRE_INCLUDE_DIRS pcre SOURCE_DIR)
  23. set(PCRE_CFLAGS -DPCRE_STATIC)
  24. endif()