GetCCTZ.cmake 975 B

123456789101112131415161718192021222324252627
  1. cmake_minimum_required ( VERSION 3.17 FATAL_ERROR )
  2. set ( CCTZ_REPO "https://github.com/manticoresoftware/cctz" )
  3. set ( CCTZ_REV "8ca8e32" )
  4. set ( CCTZ_SRC_MD5 "60b00168c0a821030230383621bf3df2" )
  5. set ( CCTZ_GITHUB "${CCTZ_REPO}/archive/${CCTZ_REV}.zip" )
  6. set ( CCTZ_BUNDLE "${LIBS_BUNDLE}/cctz-${CCTZ_REV}.zip" )
  7. include ( update_bundle )
  8. # try to find quietly (will work most time
  9. find_package ( cctz QUIET CONFIG )
  10. return_if_target_found ( cctz::cctz "found ready (no need to build)" )
  11. # not found. Populate and prepare sources
  12. select_nearest_url ( CCTZ_PLACE cctz ${CCTZ_BUNDLE} ${CCTZ_GITHUB} )
  13. fetch_and_check ( cctz ${CCTZ_PLACE} ${CCTZ_SRC_MD5} CCTZ_SRC )
  14. # build external project
  15. get_build ( CCTZ_BUILD cctz )
  16. external_build ( cctz CCTZ_SRC CCTZ_BUILD CCTZ_BUILD_TOOLS=0 CCTZ_BUILD_EXAMPLES=0 CCTZ_BUILD_BENCHMARK=0 CCTZ_BUILD_TESTING=0 )
  17. # now it should find
  18. find_package ( cctz REQUIRED CONFIG )
  19. return_if_target_found ( cctz::cctz "was built and saved" )