GetUniAlgo.cmake 1.1 KB

1234567891011121314151617181920212223
  1. cmake_minimum_required ( VERSION 3.17 FATAL_ERROR )
  2. set ( UNIALGO_GITHUB "https://github.com/manticoresoftware/uni-algo/archive/refs/tags/v0.7.2.tar.gz" )
  3. set ( UNIALGO_BUNDLE "${LIBS_BUNDLE}/unialgo-v0.7.2.tar.gz" )
  4. set ( UNIALGO_SRC_MD5 "11f64b34000f3b98fa806d01eeeda70b" )
  5. include ( update_bundle )
  6. # determine destination folder where we expect pre-built uni-algo
  7. find_package ( uni-algo QUIET CONFIG )
  8. return_if_target_found ( uni-algo::uni-algo "found ready (no need to build)" )
  9. # not found. Populate and prepare sources
  10. select_nearest_url ( UNIALGO_PLACE uni-algo ${UNIALGO_BUNDLE} ${UNIALGO_GITHUB} )
  11. fetch_and_check ( uni-algo ${UNIALGO_PLACE} ${UNIALGO_SRC_MD5} UNIALGO_SRC )
  12. # build external project
  13. get_build ( UNIALGO_BUILD uni-algo )
  14. external_build ( uni-algo UNIALGO_SRC UNIALGO_BUILD UNI_ALGO_DISABLE_PROP=1 UNI_ALGO_DISABLE_BREAK_WORD=1 UNI_ALGO_DISABLE_COLLATE=1 UNI_ALGO_DISABLE_NFKC_NFKD=1 UNI_ALGO_DISABLE_SHRINK_TO_FIT=1 )
  15. # now it should find
  16. find_package ( uni-algo REQUIRED CONFIG )
  17. return_if_target_found ( uni-algo::uni-algo "was built and saved" )