message: [CMake] Attempts to fix PPA build for Ubuntu 18.04
diff: @@ -11,9 +11,6 @@ endif()
  # TODO: coretext_shaper.cpp coretext_shaper.h
  add_library(text_shaper STATIC ${text_shaper_SRC})
  -find_package(Fontconfig REQUIRED)
  -find_package(Freetype REQUIRED)
  -
  set(TEXT_SHAPER_LIBS unicode::core)
  list(APPEND TEXT_SHAPER_LIBS fmt::fmt-header-only)
  @@ -30,14 +27,22 @@ if(APPLE)
  list(APPEND TEXT_SHAPER_LIBS Freetype::Freetype)
  list(APPEND TEXT_SHAPER_LIBS PkgConfig::harfbuzz)
  elseif("${CMAKE_SYSTEM}" MATCHES "Linux")
  + execute_process(COMMAND lsb_release -a
  + OUTPUT_VARIABLE LSB_RELEASE_OUTPUT)
  + if ("${LSB_RELEASE_OUTPUT}" MATCHES "bionic")
  + message(STATUS "Ubuntu 18.04 detected. Using pkg-config to detect fontconfig.")
  find_package(PkgConfig REQUIRED)
  - #find_package(Fontconfig REQUIRED)
  pkg_check_modules(Fontconfig REQUIRED IMPORTED_TARGET fontconfig)
  + list(APPEND TEXT_SHAPER_LIBS PkgConfig::Fontconfig)
  + else()
  + message(STATUS "Using find_package to detect fontconfig.")
  + find_package(Fontconfig REQUIRED)
  + list(APPEND TEXT_SHAPER_LIBS Fontconfig::Fontconfig)
  + endif()
  find_package(Freetype REQUIRED)
  pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz)
  list(APPEND TEXT_SHAPER_LIBS PkgConfig::harfbuzz)
  list(APPEND TEXT_SHAPER_LIBS Freetype::Freetype)
  - list(APPEND TEXT_SHAPER_LIBS PkgConfig::Fontconfig)
  elseif("${CMAKE_SYSTEM}" MATCHES "Windows")
  # installed via vcpkg
  find_package(harfbuzz CONFIG REQUIRED)
  