1
0

vcpkg-cmake-wrapper.cmake 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. cmake_policy(PUSH)
  2. cmake_policy(SET CMP0012 NEW)
  3. cmake_policy(SET CMP0054 NEW)
  4. _find_package(${ARGS})
  5. if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
  6. if("@FT_REQUIRE_ZLIB@")
  7. find_package(ZLIB)
  8. endif()
  9. if("@FT_REQUIRE_BZIP2@")
  10. find_package(BZip2)
  11. endif()
  12. if("@FT_REQUIRE_PNG@")
  13. find_package(PNG)
  14. endif()
  15. if("@FT_REQUIRE_BROTLI@")
  16. find_library(BROTLIDEC_LIBRARY_RELEASE NAMES brotlidec brotlidec-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
  17. find_library(BROTLIDEC_LIBRARY_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
  18. find_library(BROTLICOMMON_LIBRARY_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
  19. find_library(BROTLICOMMON_LIBRARY_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
  20. include(SelectLibraryConfigurations)
  21. select_library_configurations(BROTLIDEC)
  22. select_library_configurations(BROTLICOMMON)
  23. endif("@FT_REQUIRE_BROTLI@")
  24. if(TARGET Freetype::Freetype)
  25. if("@FT_REQUIRE_ZLIB@")
  26. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
  27. endif()
  28. if("@FT_REQUIRE_BZIP2@")
  29. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2)
  30. endif()
  31. if("@FT_REQUIRE_PNG@")
  32. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES PNG::PNG)
  33. endif()
  34. if("@FT_REQUIRE_BROTLI@")
  35. if(BROTLIDEC_LIBRARY_DEBUG)
  36. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<CONFIG:DEBUG>:${BROTLIDEC_LIBRARY_DEBUG}>")
  37. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<CONFIG:DEBUG>:${BROTLICOMMON_LIBRARY_DEBUG}>")
  38. endif()
  39. if(BROTLIDEC_LIBRARY_RELEASE)
  40. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<NOT:$<CONFIG:DEBUG>>:${BROTLIDEC_LIBRARY_RELEASE}>")
  41. set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES "\$<\$<NOT:$<CONFIG:DEBUG>>:${BROTLICOMMON_LIBRARY_RELEASE}>")
  42. endif()
  43. endif()
  44. endif()
  45. if(FREETYPE_LIBRARIES)
  46. if("@FT_REQUIRE_ZLIB@")
  47. list(APPEND FREETYPE_LIBRARIES ${ZLIB_LIBRARIES})
  48. endif()
  49. if("@FT_REQUIRE_BZIP2@")
  50. list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES})
  51. endif()
  52. if("@FT_REQUIRE_PNG@")
  53. list(APPEND FREETYPE_LIBRARIES ${PNG_LIBRARIES})
  54. endif()
  55. if("@FT_REQUIRE_BROTLI@")
  56. list(APPEND FREETYPE_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES})
  57. endif()
  58. endif()
  59. endif()
  60. cmake_policy(POP)