GetxxHash.cmake 959 B

1234567891011121314151617181920212223242526
  1. cmake_minimum_required ( VERSION 3.17 FATAL_ERROR )
  2. set ( XXH_REPO "https://github.com/manticoresoftware/xxHash" )
  3. set ( XXH_REV "72997b0" )
  4. set ( XXH_SRC_MD5 "90a5d68bf9d3adbb6d6155bbf12805de" )
  5. set ( XXH_GITHUB "${XXH_REPO}/archive/${XXH_REV}.zip" )
  6. set ( XXH_BUNDLE "${LIBS_BUNDLE}/xxHash-${XXH_REV}.zip" )
  7. include ( update_bundle )
  8. # determine destination folder where we expect pre-built xxhash
  9. find_package ( xxHash QUIET CONFIG )
  10. return_if_target_found ( xxHash::xxhash "found ready (no need to build)" )
  11. # not found. Populate and prepare sources
  12. select_nearest_url ( XXH_PLACE xxhash ${XXH_BUNDLE} ${XXH_GITHUB} )
  13. fetch_and_check ( xxhash ${XXH_PLACE} ${XXH_SRC_MD5} XXH_SRC )
  14. # build external project
  15. get_build ( XXH_BUILD xxhash )
  16. external_build ( xxhash XXH_SRC XXH_BUILD BUILD_SHARED_LIBS=0 XXHASH_BUILD_XXHSUM=0 )
  17. # now it should find
  18. find_package ( xxHash REQUIRED CONFIG )
  19. return_if_target_found ( xxHash::xxhash "was built and saved" )